Question: Sample problem: Programming The formula for the volume of a sphere is 4 where is 3.14159 and r is the radius of the sphere. Write

 Sample problem: Programming The formula for the volume of a sphere

Sample problem: Programming The formula for the volume of a sphere is 4 where is 3.14159 and r is the radius of the sphere. Write a function named volume that accepts a radius as an argument. The function should return the volume of a sphere having that radius. Demonstrate the function by calling it in a loop in the main function that displays a table of volumes of circles with radius values 1 through 10. Your function should work properly if the radius has a fractional part (i.e. 5.89)

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!