Question: Write a program that defines the named constant PI, const double PI = 3.14159;, which stores the value of . The program should use PI
Write a program that defines the named constant PI, const double PI = 3.14159;, which stores the value of . The program should use PI and the functions listed in Table 6-1 to accomplish the following:
- Output the value of .
- Prompt the user to input the value of a double variable r, which stores the radius of a sphere. The program then outputs the following:
- The value of 4.0r, which is the surface area of the sphere.
- The value of (4.0/3.0)r, which is the volume of the sphere.
You should format your output like the following example:
Surface area of the sphere: 4 * PI * 5.00 ^ 2 = 314.16 Volume of the sphere: 4 / 3 * PI * 5.00 ^ 3 = 523.60
Your output must match the wording precisely to earn full credit. Format your output with setprecision(2) to ensure the proper number of decimals for testing!
if I can copy paste it would be better.
Result int (double) double double double double Parameter(s) Function Header File Purpose Type abs(x)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
