import java.awt.*;

public class Rect2 extends Shape implements Drawable
{
  private int width;
  private int height;

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

  public Rect2(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 void draw(Graphics g)                          // new method for
  {                                                     // drawing the rect.
    g.drawRect(getX(), getY(), width, height);
  }

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