Question: C++ (use Classes) Problem Definition Create a class called Rectangle. This class stores only the Cartesian coordinates of the four coordinates of the rectangle. P2(9,3)
C++
(use Classes)





Problem Definition Create a class called Rectangle. This class stores only the Cartesian coordinates of the four coordinates of the rectangle. P2(9,3) P1(3,3) P4(3,0) P3(9,0) Use integer variables to represent the data of the class: the x and y coordinates of the four corners of the rectangle. Provide a constructor that enables an object of this class to be initialized when it is declared The constructor should contain default corner values in case no initializers are provided. Provide member functions that: Calculate the perimeter Calculate the area Calculate the width (Dimension along the horizontal line) Calculate the length (The larger of the two dimensions) Print the rectangle corners The implementation of the class rectangle is divided in two steps
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
