Question: Construct a class named Rectangle that has double-precision data members named length and width. The class should have member functions named perimeter() and area() to

Construct a class named "Rectangle" that has double-precision data members named "length" and "width". The class should have member functions named "perimeter()" and "area()" to calculate the rectangle's perimeter and area, a member function named "setData()" to set a rectangle's length and width, and a member function named "showData()" that displays a rectangle's length, width, perimeter, and area.

This class will be included in a C++ program that will prompt the user for the length and width of a rectangle and displays the rectangle's length, width, perimeter, and area. The program shall also ask the user if they want to repeat the program by entering "yes". You must account for variations of yes. by using the tolower or toupper method.

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!