(Problem 9.20, Rectangle Class) Create a class Rectangle with attributes length and width....

(Problem 9.20, Rectangle Class) Create a class Rectangle with attributes length and width....

(Problem 9.20, Rectangle Class) Create a class Rectangle with attributes length and width, each of which defaults to 1. Provide member functions that calculate the perimeter and the area of the rectangle.  Also, provide set and get functions for the length and width attributes. The set functions should verify that length and width are each floating-point numbers larger than 0.0 and less than 20.0. In C++ language. 


Sample Session:

a: length = 1.0; width = 1.0; perimeter = 4.0; area = 1.0
b: length = 5.0; width = 4.0; perimeter = 18.0; area = 20.0
Powered by