Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 stepsStep 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