Question
c++ Define the following modular functions: CalcConeBaseArea() takes one double parameter as a cone's radius. The function returns the area of the cone's base as
c++
Define the following modular functions: CalcConeBaseArea() takes one double parameter as a cone's radius. The function returns the area of the cone's base as a double. The area of the base is calculated by: CalcConeVolume() takes two double parameters as a cone's radius and height. The function returns the cone's volume as a double, using the CalcConeBaseArea() function. The volume is calculated by: Ex: If userRadius is 4.0 and userHeight is 3.0, then the output is: Base area: 50.3 Volume: 50.3 Note: Use M_PI for .
#include
/* Your code goes here */
int main() { double userRadius; double userHeight; cin >> userRadius; cin >> userHeight;
cout << fixed << setprecision(1);
cout << "Base area: "; cout << CalcConeBaseArea(userRadius) << endl;
cout << "Volume: "; cout << CalcConeVolume(userRadius, userHeight) << endl; return 0; }
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