import java.awt.*;

public class Rect3 extends Shape implements Comparable
{
  private int width;
  private int height;

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

  public Rect3(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 int compareTo(Object otherRect)  // required to implement the 
  {                                       // interface Comparable 
    Rect3 other = (Rect3) otherRect;
    int square1 = width * height;
    int square2 = other.width * other.height;
    if (square1 < square2) return(-1);
    if (square1 > square2) return(1);
    return(0);
  }

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