Got real head scratcher here, I have no idea where to begin any help would be greatly appreciated..


Make a class rectangle. The class should have data members length and width of type float, each of which defaults to 1. The class should have member functions that calculate the perimeter() and the area() of the rectangle. It should also have separate set() and get() functions for both the length and width (set_length(), get_length(), set_width(), get_width()).

The set_length() and set_width() functions should require the user to enter length or width data values greater than zero and less than or equal to 20.0. These functions should examine the data entered by the user, and accept the data only if it is in the specified range (0 < data <= 20.0). If the data is not in this range, the user should be reminded of the allowed data range and prompted to enter the data again. This cycle should repeat until the user enters a correct data value. This can be accomplished by using a do while loop in each set() function.

The get() functions should be declared using the const keyword to ensure that these functions can not change private member data of the rectangle class.

Add a draw() function to your rectangle class that draws a solid rectangle of the correct length and width. Since the length and width in are floating point numbers, truncate the length and width values for the purpose of drawing the rectangle (for example, if length = 6.3 and width = 11.5, draw a rectangle that is 6 by 11 characters in size). Use any character you like to draw the rectangle. Here is an example of a rectangle drawn with + signs:

+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++

Write a short demonstration program that uses the rectangle class you have created. The program should create a rectangle object, then prompt the user to enter new values for the length and width. Use the set() functions and the userís entries to change the private data of the rectangle object you created. Finally, call the draw() function to display the resulting rectangle.


I dont understand. :(