
public class Rectangle {

	private int width, height;

	public Rectangle() {
		width = 25;
		height = 10;
		System.out.println("Default rectangle created: width = 25, height = 10");
	}

	public Rectangle(int w, int h) {
		if (w > 0 && w < 30 && h > 0 && h < 30) {
			width = w;
			height = h;
			System.out.println("A rectangle created: width = " + w + ", height = " + h);
		} else {
			System.out.println("Out of range: width and height must be between 0 and 30.");
		}
	}

	public int getArea() {
		return height * width;
	}

	public void draw() {
		for (int row = 0; row < height; row++) {
			for (int col = 0; col < width; col++) {
				System.out.print("*");
			}
			System.out.println();
		}
	}
}
