Question: we want the program to do the same thing, but with not one main() function, but instead one main() function PLUS one user defined function

we want the program to do the same thing, but with not one main() function, but instead one main() function PLUS one user defined function called computeConeVolume that contains the calculation. In other words, remove the one line calculation, replace it with a function call, then write and add the function below main with the calculation, surrounded any other syntax you need to complete it. in C++

- I need some help, thanks!

#include using namespace std;

int main() { //Declare variables and constants double coneRadius = 0.0; double coneHeight = 0.0; const double PI = 3.14; double coneVolume = 0.0;

//Prompt the user for inputs cout << "Enter the radius of the cone: "; cin >> coneRadius; cout << "Enter the height of the cone: "; cin >> coneHeight;

//Do the calculation coneVolume = 0.33 * PI * coneRadius * coneRadius * coneHeight;

//Display the result cout << "The volume of your cone is: " << coneVolume << endl;

system("pause"); return 0; } //end of main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!