Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need this code. explain how it works too thank you 5. Create a Rectangle class with the following properties: 1. Private data members of
I need this code. explain how it works too thank you
5. Create a Rectangle class with the following properties: 1. Private data members of type float: length and width. i. Public accessor member functions: getLength() and get Width(). 111. Public mutator member functions: setLength() and setWidth. iv. Constructor member function that allows you to initialize the length and width data members as well as set these data members to zero if not initialized. V. Public member function getArea() - computes and returns the area of the Rectangle object vi. Public member function getPeri() - computes and returns the perimeter of the Rectangle object. vii. Overloaded assignment operator *** In the main() function, create and initialize two Rectangle objects Rectl and Rect2. Rectl will have a length = 5.0 and width = 4.0. Rect2 will have a length = 7.0 and width = 5.0. Also, create a third Rectangle object, Rect3, which will be set equal to Rectl using the overloaded assignment operator. Finally, use cout to display the area and perimeter of these three Rectangle objectsStep 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