Question: write C++ code for problem Problem: Suppose your math professor asks you to create a calculator to determine the volume of a cone based on

write C++ code for problem
 write C++ code for problem Problem: Suppose your math professor asks

Problem: Suppose your math professor asks you to create a calculator to determine the volume of a cone based on its height and radius. To make it more charming you decide that your program will ask the user's name before asking for the needed data to calculate the volume. You must use the formula shown below where r is the radius and h is the height of the cone. Cone The height and the radius must be whole numbers but the volume must be a double precision real number with three decimal digits. Your task: implement in C++ the algorithm solution shown below. Algorithm solution (in pseudocode): To solve this problem your program must perform the following tasks: Declares a global constant variable called PI that holds value 3.141592 Declares a variable named name that holds text. Declares variables named height and radius that hold whole numbers. Declares a variable named volume that holds double precision real numbers. Prompts the user "May I get your first name please?". Reads the value from the keyboard and stores it in name. Prompts the user "Thanks ". name, ". now enter height and radius of the cone please: Reads the values from the keyboard and stores them in height and radius respectively. Calculates the volume using the formula shown in the figure above Rounds the volume to the nearest thousandths (three decimal digits) and reassigns it to volume. Formats the output to display the volume in fixed format with three decimal digits. Prints a message like the one below: "Ok", name, the cone's volume is ". volume *Implement this formula exactly as it is displayed You need to define three value-returning and one void functions to implement this solution

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!