Your job is to complete the program. When it is complete, the program will ask the user to enter the width and length of a rectangle, then display the rectangle's area. The program calls the following functions, which have not been written: getLength- This function shold ask the user to enter the retangle's length then return that value as double. getWidth- This function should ask the user to enter the retangle's width then return that value as double. 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. All coding is done in C++.
Hello, need help with this homework question.
This is from the book starting out with>>> C++ From control structures through objects, ninth edition.
Author: Tony Gaddis
All coding is done in C++.
Attached is the image of the pre-
Rectangle Area-Complete the Program
If you have downloaded this book's source code, you will find a partially written program named AreaRectangle.cpp in the Chapter 06 folder. Your job is to complete the program. When it is complete, the program will ask the user to enter the width and length of a rectangle, then display the rectangle's area. The program calls the following functions, which have not been written:
getLength- This function shold ask the user to enter the retangle's length then return that value as double.
getWidth- This function should ask the user to enter the retangle's width then return that value as double.
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.
All coding is done in C++.


Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images









