public class Rect5 extends Shape5
{
  private int width;
  private int height;

  public Rect5()
  {
     super();
     width = height = 0;
  }

  public Rect5(int xLoc, int yLoc, int width, int height)
  {
     super(xLoc, yLoc);
     this.width = width;
     this.height = height;
  }

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

  public void stretchBy(double factor)
  {
     width =  (int)Math.round(width * factor);
     height = (int)Math.round(height * factor);
  }

  public String toString()
  {
     String str = "RECTANGLE \n"
                + super.toString()
                + "Width & Height: " + width + " " + height + "\n"
                + "Area: " + getArea();
     return str;
  }

  public boolean equals(Object otherRect)
  {
    if (! super.equals(otherRect)) return(false);
    Rect5 other = (Rect5) otherRect;
    return(width == other.width && height == other.height);
  }
}
