Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Rectangle AreaComplete the Program . The program calls the following functions, which have not been written: getLength This function should ask the user to enter

Rectangle AreaComplete the Program . The program calls the following functions, which have not been written:

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 .

getArea 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.

.

#include

using namespace std;

// Function prototypes

double getLength();

double getWidth();

double getArea(double, double);

void displayData(double, double, double);

int main()

{

double length; // To hold the rectangle's length

double width; // To hold the rectangle's width

double area; // To hold the rectangle's area

// Call the getLength function to get the rectangle's length.

// Call the getWidth function to get the rectangle's width.

// Call the getAres function to calculate the rectangle's area.

// Call the displayData function to display the rectangle's data.

return 0;

}

//***************************************************

// getLength function *

//***************************************************

//***************************************************

// getWidth function *

//***************************************************

//***************************************************

// getArea function *

//***************************************************

//***************************************************

// displayData function *

//***************************************************

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

Students also viewed these Databases questions

Question

=+2 Why did OBI create Centers of Excellence?

Answered: 1 week ago