Question: P5.11 Write functions double sphere_volume (double r) double sphere_surface(double r) Programming Exercises 239 double cylinder_volume (double r, double h) double cylinder_surface (double r, double h)

 P5.11 Write functions double sphere_volume (double r) double sphere_surface(double r) ProgrammingExercises 239 double cylinder_volume (double r, double h) double cylinder_surface (double r,double h) double cone_volume (double r, double h) double cone_surface (double r,

P5.11 Write functions double sphere_volume (double r) double sphere_surface(double r) Programming Exercises 239 double cylinder_volume (double r, double h) double cylinder_surface (double r, double h) double cone_volume (double r, double h) double cone_surface (double r, double h) that compute the volume and surface area of a sphere with radius r, a cylinder with a circular base with radius r and height h, and a cone with a circular base with radius r and height h. Then write a program that prompts the user for the values of rand h, calls the six functions, and prints the results. Font agraph Requirements: Please work on P5.11 on page 238. Your program should prompt the user for 2 values (radius and height). When you test your program, please assign 4 to the variable r (for example, r = 4.0) and assign 8 to the variable h (for example, h = 8.0) so that you and me both can check your program and figure out whether your program produces the right answer. Output - Your program should generate a table with a table header as following: Volume Surface Sphere Cylinder Cone Final Note: 1) Do not deviate from the requirements stated here, and 2) The output values should show 2 decimal places. Please use a format statement such as setprecision(2) to implement this requirement. Test Cases: Please use the following test cases to test your program. Case 1: Radius: -4 (Your program should generate an error message and stop processing) Next, prompt the user for continuation. Example, send a message as "Do you want to continue (y)? Case 2: Height: -8 (Your program should generate an error message and stop processing) Next, prompt the user for continuation. Example, send a message as "Do you want to continue (y)? Case 3: Radius: 4 Height: 8 Message: "Do you want to continue (y)?" Case 4: Radius: Q send a message: "Exit!" Due date: TBD Submission includes 1) The cover page 2) The source listing 3) A screen shot of program execution. Thanks

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!