Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

7. Where Do We Begin?

Answered: 1 week ago