Question: Write a program that asks a user to enter a radius value. Implement two user defined functions, circleArea , and sphereVolume to calculate the area

Write a program that asks a user to enter a radius value.
Implement two user defined functions,circleArea, andsphereVolumeto calculate the area of the circle and volume of the sphere using the given radius.
Use these equations for the calculations where is the radius:
o Area of the Circle
o Volume of the SphereHint: Be aware of the integer division problem.
The mathematical constant must be declared as a constant with the value of 3.14159.
Both functions take one parameter ofdoubletype and return adoubleresult.
Write adequate preconditions and postconditions comments for both functions.
The functions prototypes must be declared above the main function and the definitions must be placed below the main function.
Write a mainfunction that calls the two user defined functions

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!