Question: Write a program that asks the user for a sphere radius in centimeters ( a float ) and displays its corresponding diameter and volume: diameter

Write a program that asks the user for a sphere radius in centimeters (a float) and displays its corresponding diameter and volume:
diameter\=\2\times radius
diameter =2\times radius
volume\=\\frac{4}{3}\times\Pi\times radius^3
volume =
3
4
\times \Pi \times radius
3
The values for the diameter and the volume should be rounded to 2 decimal places. You may use the round() function to do so.
Example:
Please enter a radius value (in cm) : 2
For the sphere of radius 2.0(cm):
the diameter is =4.0 and volume is =33.51
Note: The printed message should be exactly as shown in the example in order to pass the autograder tests

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 Programming Questions!