Question: 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

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 objects

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!