Implement a subclass Square that extends the Rectangle class. In the constructor, accept the x- and y-positions of the center and the side length of the square. Call the setLocation and setSize methods of the Rectangle class. Look up these methods in the documentation for the Rectangle class. Also supply a method getArea that computes and returns the area of the square. Write a sample program that asks for the center and side length, then prints out the square (using the toString method that you inherit from Rectangle) and the area of the square.

Complete the following files:

Square.java

SquareTester2.java

Use the following file:

SquareTester.java

/**
   This class tests the Square class.
*/
public class SquareTester
{
   public static void main(String[] args)
   {
      Square sq = new Square(10, 20, 30);
      System.out.println(sq.toString());
      System.out.println("Expected: Square[x=-5,y=5,width=30,height=30]");
      System.out.println("Area: " + sq.getArea());
      System.out.println("Expected: 900");
   }
}