Create a base class named Point, consisting of x and y data members representing
ID: 3865958 • Letter: C
Question
Create a base class named Point, consisting of x and y data members representing point coordinates. Also create a class named Rectangle with two members of type Point. These members represent opposite vertices making up the rectangle, with sides parallel to the x and y axis. The class Rectangle shall have member functions to 1. calculate and return the width as the length of the side parallel to the axis, 2, calculate and return the height as the length of the side parallel to the y axis, 3, calculate and return the rectangle, 4, calculate and return the perimeter of the rectangle. The class Rectangle shall also have appropriate mutator and accessor functions as well as appropriate constructors (i.e. default constructor, constructor for one set of coordinates, to sets, one and two Point parameters).Explanation / Answer
Point.h :-
---------------------------------
Rectangle.h :-
-----------------------------
Point.cpp :-
-------------------------
------------------------------------
-------------------------