Question: create a C + + program that will calculate the volume of a cone. The program should have the following four functions: One function that

create a C++ program that will calculate the volume of a cone. The program should have the following four functions:
One function that will ask the user to enter an integer between 1 and 30, inclusive, as the radius and return the radius. If the radius is not between 1 and 30, the program will ask the user to enter another radius. The function only returns a number between 1 and 30. Name the function as radius()
One function that randomly generates a number between 7 and 20, inclusive, and returns the random number. Name the function as height()
One function, named volume(), that takes the radius and height from the functions radius() and height() respectively, as arguments and calculates the volume of a cone using the formula:
volume =(1/3)* PI * radius2* height
The PI value should be declared as a constant global variable with value 3.1416.
The function returns the calculated volume as a float or double number.
One function that prompts the result is
The volume of a cone with radius of ___cm and a height of ____cm is _____cm^3

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!