Using C++
need answered within 2 hours please
Using C++
Rectangle in a Coordinate System The following figure represents rectangles in an x, y coordinate systems. Each rectangle has four points. Each point is represented with their x and y coordinates For example, point A is the top left most comer of one of the rectangles below and it has x and y values 3 and 6 respectively. You will implement Point.cpp and Rectangle.cpp given their header files Point.h and Rectangle.h Point. Difndef Point #define Point_n class Point friend std::ostream& operator cistd::ostream &, Point 6); public: explicit Point (double 8.0, double 8.a); -Point(); Point & setx{double); Point & setY(double); double getX() const; double getY() const; private: double x; double y: }; #endif / Point_ */ Step 1. Implement Point.cpp (30 points) 1. Constructor and destructor. The constructor should set x and y data members by calling their setters in a cascading function call style and display a message saying the constructor of Point object is being called. The destructor should also display a similar message indicating the destructor for a Point object is being called. b. Setters and getters: Implement the setters and getters for x and y data members. The setters must allow cascading function calls. c. Overloading d. calculate Area(): This function returns the area of the rectangle. To calculate area, you must first calculate the length of sides of the rectangle. e. calculate Perimeter(): This function returns the perimeter of the rectangle. To be able to calculate that you must again calculate sides of the rectangle. Step 3. Test your classes with the following main.cpp #include
#include "Rectangle.h" #include "Point.h" using namespace std; int main(int argc, const char * argv[]) { Point al{3,6}; Point b1{7,6); Point c1{7,3}; Point d1{3,3}; Point a2{5,5); Point b2{9,4}; Point c248,0}; Point d2(4,1); Rectangle rec1{a1, b1, ci,d1}; Rectangle rec2(a2,b2, c2, d2}; cout