Question: I need a C++ program that will ask the user to enter the width and length of a rectangle, and then display the rectangle's area.
I need a C++ program that will ask the user to enter the width and length of a rectangle, and then display the rectangle's area. The program should call the following functions:
-getLength - this function should ask the user to enter the rectangle's length and then return the value as a float.
-getWidth - this function should ask the user to enter the rectangle's width and then return the value as a float.
-getArea - this function should accept the rectangle's length and width as arguments and return the rectangle's area. The area is calculated by multiplying the length by the width.
-displayData - this function should accept the rectangle's length, width, and area as arguments, and display them in an appropriate message on the screen.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
