Want Program Thing One Main Function Instead One Main Function Plus One User Defined Funct Q43838842
we want the program to do the same thing, but with not onemain() function, but instead one main() function PLUS one userdefined function called computeConeVolume that contains thecalculation. In other words, remove the one line calculation,replace it with a function call, then write and add the functionbelow main with the calculation, surrounded any other syntax youneed to complete it. in C++
– I need some help, thanks!
#include <iostream>
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
Expert Answer
Answer to we want the program to do the same thing, but with not one main() function, but instead one main() function PLUS one use…
OR