C++ Create a program that will accept a radius value from the keyboard and calculate the Volume of a Sphere and the Surface Area of a sphere. Separate the program into three files. The main program containing the main function should be named main.cpp. The function definition file containing a function for the volume calculation and a function for the surface area calculation should be named SphereCalc.cpp. The function declaration file containing function declarations for the functions should be named SphereCalc.h. Make sure you include a Header Guard. Read the Radius from the Keyboard. If a negative number is provided, set the calculated value to zero. Set the output to be fixed with a precision of 3 positions to the right of the decimal point. An example of the output for Radius 3.0 is: Volume: 113.097 Area: 113.097 Test the function using a radius of 4.0
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
C++
Create a
Make sure you include a Header Guard.
Read the Radius from the Keyboard. If a negative number is provided, set the calculated value to zero.
Set the output to be fixed with a precision of 3 positions to the right of the decimal point. An example of the output for Radius 3.0 is: Volume: 113.097 Area: 113.097
Test the function using a radius of 4.0
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images