#include <iostream>
#include<cmath>
using namespace std;
class Rectangle{
public:
Rectangle();
Rectangle(double p1_x,double p1_y,double p2_x,double p2_y):x1(p1_x),y1(p1_y),x2(p2_x),y2(p2_y){
cout<<"Constructor called"<<endl;}
double area();
void setRectangle(double p1_x,double p1_y,double p2_x,double p2_y){
x1=p1_x;
y1=p1_y;
x2=p2_x;
y2=p2_y;
}
double getp1_x(){return x1;}
double getp1_y(){return y1;}
double getp2_x(){return x2;}
double getp2_y(){return y2;}
~Rectangle()
{cout<<"Destructor called."<<endl;}
private:
double x1;double y1;double x2;double y2;
};
Rectangle::Rectangle()
{x1=0;y1=0;x2=0;y2=0;}
double Rectangle::area()
{return abs(x2-x1)*abs(y2-y1);}
int main()
{Rectangle r(1,2,3,4);
r.setRectangle(1,2,2,4);
cout<<r.area()<<endl;
return 0;
}