Rectangle

Write a program that reads the X and Y coordinates of two points and
then outputs the area of a rectangle where
both points are opposite corners. Use the following class to store the
data for the points:
class Rectangle {
Point upLeft;
Point downRight;
}
Your program should calculate (and write on the screen) the perimeter
and area of the rectangle.