The program will use as the input, the length and width of a rectangle. The output of the program will be the area and perimeter of the rectangle.
Your program will contain a class called Rectangle. The class should also have at least two, and maybe more, member functions. One for getting, from the user, the length and width of the rectangle and the second for printing the area and perimeter of the rectangle. The input provided by the user must be greater than 0 and less than or equal to 20.0. If the user enters data that is less than or equal to 0 or greater than 20.0, then the program should output an appropriate error message.
The main program should instantiate an instance of the class Rectangle and then make calls to the member functions to input the data and output the results. The main program should only make calls to the member functions. No input or output should be done from the main program.
Calculations should be as follows.
Area = length * width
Perimeter = (2 * length) + (2 * width)
For the purposes of this program you can assume that that no character data will be used for input. However, do not assume that the input will be within the above specified range.
Also, for the purposes of this program you can use the following main() function.
void main()
{
Rectangle R;
R.getData();
R.printData();
return 0;
}