#include <iostream.h>
class Point
{
private:
int itsX;
int itsY;
public:
void SetX(int x) {itsX=x;}
void SetY(int y) {itsY=y;}
int GetX()const {return itsX;}
int GetY()const {return itsY;}
};
class Rectangle
{
private:
Point itsUpperLeft;
Point itsUpperRight;
Point itsLowerLeft;
Point itsLowerRight;
int itsTop;
int itsBottom;
int itsLeft;
int itsRight;
public:
Rectangle(int top,int left,int bottom,int right);
~Rectangle(){}
int GetTop() const {return itsTop;}
int GetBottom() const {return itsBottom;}
int GetLeft() const {return itsLeft;}
int GetRight() const {return itsRight;}
void SetTop(int top) {itsTop=top;}
void SetBottom(int bottom) {itsBottom=bottom;}
void SetLeft(int left) {itsLeft=left;}
void SetRight(int right) {itsRight=right;}
Point GetUpperLeft() const {return itsUpperLeft;}
Point GetLowerLeft() const {return itsLowerLeft;}
Point GetUpperRight() const {return itsUpperRight;}
Point GetLowerRight() const {return itsLowerRight;}
void SetUpperLeft(Point Location) {itsUpperLeft=Location;}
void SetLowerLeft(Point Location) {itsLowerLeft=Location;}
void SetUpperRight(Point Location) {itsUpperRight=Location;}
void SetLowerRight(Point Location) {itsLowerRight=Location;}
int GetArea() const;
};
Rectangle::Rectangle(int top,int left,int bottom,int right)
{
itsTop=top;
itsBottom=bottom;
itsLeft=left;
itsRight=right;
itsUpperLeft.SetX(left);
itsUpperLeft.SetY(top);
itsUpperRight.SetX(right);
itsUpperRight.SetY(top);
itsLowerLeft.SetX(left);
itsLowerLeft.SetY(bottom);
itsLowerRight.SetX(right);
itsLowerRight.SetY(bottom);
}
int Rectangle::GetArea() const
{
int Width=itsRight-itsLeft;
int Height=itsTop-itsBottom;
return (Width*Height);
}
int main()
{
int a,b,c,d;
cout<<"Please inpute the UpperRightX UpperRighty LowerLeftX LowerLeftY "<<endl;
cin>>d>>a>>b>>c;
Rectangle MyRectangle(a,b,c,d);
int Area=MyRectangle.GetArea();
cout<<"The Area of the Rectangle is:"<<Area<<"\n";
cout<<"UpperLeft"<<"("<<MyRectangle.GetUpperLeft().GetX()<<","<<MyRectangle.GetUpperLeft().GetY()<<")"<<endl;
cout<<"UpperRight"<<"("<<MyRectangle.GetUpperRight().GetX()<<","<<MyRectangle.GetUpperRight().GetY()<<")"<<endl;
cout<<"UpperLeft"<<"("<<MyRectangle.GetLowerLeft().GetX()<<","<<MyRectangle.GetLowerLeft().GetY()<<")"<<endl;
cout<<"UpperRight"<<"("<<MyRectangle.GetLowerRight().GetX()<<","<<MyRectangle.GetLowerRight().GetY()<<")"<<endl;
return 0;
}