Question: Construct a class named Rectangle that has two double-precision data members named length and width. The class should have the following class functions: a) A
Construct a class named Rectangle that has two double-precision data members named length and width. The class should have the following class functions: a) A constructor with the default values of 1 for both length and width data members b) An accessor function named showData() to show a rectangle's length and width c) A mutator function named setData() to set the rectangle's length and width d) A class function named perimeter() that calculates and displays the rectangle's perimeter e) A class function named area() that calculates and displays the rectangle's area Include the Rectangle class constructed in a working C++ program and exercise all functions.
Plz, use a C++ code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
