Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need this in C++. Thank you. Problem Definition Create a class called Rectangle. This class stores only the Cartesian coordinates of the four coordinates of
need this in C++. Thank you.
Problem Definition Create a class called Rectangle. This class stores only the Cartesian coordinates of the four coordinates of the rectangle. P1(3,3) P2(9,3) P4(3.0) L 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: Part 1: Class Definition Implement the class definition for class Rectangle in a file called Rectangle/h. The class definition should contain only the prototypes of the member functions Rectangle, setcorners, getPerimemter getArea, getwidth getiength and printCorners. You can define more member functions if it is necessary, You also need to include the coordinates of the corners as integer data members. Determine if the functions and the data members should be private or publicStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started