// Aaron Tan
// MyRectangleDriver.java
// Test out the MyRectangle class
// This program asks the user for 2 opposite points of
// a rectangle, and computes the area of the rectangle.

import java.util.*;
import java.awt.*;

public class MyRectangleDriver {

   public static void main(String[] args) {

      Scanner stdIn = new Scanner(System.in);
      int x, y;

      // Create two Point objects from user's input

      System.out.print("Enter 1st point's x- and y- coordinates: ");
      x = stdIn.nextInt();
      y = stdIn.nextInt();
      Point point1 = new Point(x, y);

      System.out.print("Enter 2nd point's x- and y- coordinates: ");
      x = stdIn.nextInt();
      y = stdIn.nextInt();
      Point point2 = new Point(x, y);

      MyRectangle rect = new MyRectangle(point1, point2);
      
      // Display the rectangle
      System.out.println(rect);

      // Display the area of the rectangle
      System.out.println("Area = " + rect.getArea());

   } 

}


