Question: Write a complete program using C++ that will ask the user to enter the width and length of a rectangle, and then display the rectangles
Write a complete program using C++ that will ask the user to enter the width and length of a rectangle, and then display the rectangles area.
The program call the following functions:
.getLength This function should ask the user to enter the rectangles length, and then return that value as a double.
.getWidth this function should ask the user to enter the rectangles width, and then return that value as a double.
.get Area this function should accept the rectangles length and width as arguments, and return the rectangles area.
The area is calculated by multiplying the length by the width.
.displayData this function should accept the rectangles length, width, and area as arguments.
And display them in an appropriate message on the screen. Make the program run until you are finished testing it. (while loop or do-while loop)
Please use good comments in the code. (Please finish by the end of today if possible)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
