//********************************************************************
//  Box2D.java       Author: Rebecca Bruce
//
//  Modify the class as described in the comments below.
//********************************************************************


public class Box2D
{

    // Declare two integer instance variables named width and height.
    // The instance variables must be private.
	 private int width;
	 private int height;

    // Write a constructor that allows the user to specify initial values
    // for the two instance variables.  The values must be positive
    // integer values.
	 public Box2D(int w, int h)
	 {
		if (w >= 0)
			width = w;
		else 
			width = w * -1;

		if (h >= 0)
			height = h;
		else
			height = h * -1;
	 }

    public void setWidth(int newWidth)
    {
		width = newWidth;
    }

    public void setHeight(int newHeight)
    {
		height = newHeight;
    }

    public int getWidth()
    {
		return width;
    }

    public int getHeight()
    {
		return height;
    }

    public void display()
    {
		for(int row=0; row<height; row++)
		{
			for(int col=0; col<width; col++)
			{
				System.out.print("*");
			}
			System.out.println();
		}
    }
}
