Complete the program below that calculates the surface area and volume of a rectangular solid based on its length, width, and height. Define function rectangleAreaVolume.
#include
using namespace std;
// Put your function prototype here.
int main()
{
double length;
double width;
double height;
double sArea;
double vol;
cout << "Enter the length of the rectangular solid => ";
cin >> length;
cout << "Enter the width of the rectangular solid => ";
cin >> width;
cout << "Enter the height of the rectangular solid => ";
cin >> height;
rectangleAreaVolume( __________________, ___________________,
____________________, ____________________, _________________ );
cout << "Surface area = " << sArea << " square units." << endl;
cout << "Volume = " << vol << " cubic units." << endl;
return 0;
}
// Calculates the surface area and volume of a rectangular solid.
// Put your function definition here.
/ Prototype
void rectangleAreaVolume( double&, double&, double, double, double );
// Function call
rectangleAreaVolume( sArea, vol, length, width, height );
// Definition
void rectangleAreaVolume( double& sArea, // output - surface area
double& volume, // output
double len, // input -
double wid, // dimensions
double ht )
{
sArea = 2 * len * wid + 2 * wid * ht + 2 * ht * len;
volume = len * wid * ht;
}
You might also like to view...
To pass a variable by value in Visual Basic, you include the keyword ____ before the name of its corresponding parameter in the receiving procedure's parameterList.
A. Val B. ByVal C. Value D. ByValue
_______ is a construct that defines objects of the same type.
a. A class b. An object c. A method d. A data field
Answer the following statements true (T) or false (F)
1. An update anomaly occurs when the same data are stored in more than one place in the database. 2. REMOVE is the logical ordering of rows in a relation according to some key. 3. Presentation of the data abstracted from the database must take one of two forms: graphs and tabular forms. 4. Data mining is used to verify or validate patterns that humans are able to make themselves.
Pictures can be resized by using the Shape Height and Shape Width buttons found on the Format tab
Indicate whether the statement is true or false