Question
I having trouble defining surface area and volume in the same function for the problem I was given. Any assistance would be greatly appreciated. Thanks
I having trouble defining surface area and volume in the same function for the problem I was given. Any assistance would be greatly appreciated. Thanks
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
// Put your function prototype here. double surfaceArea(double, double, double);
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.
double surfaceArea(double length, double width ,double height) { double sArea = 2 * ((length * width) + (length * height) + (width * height));
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started