Question: Language C++ Write a program that takes a radius value from the keyboard then calculates the volume area of sphere and surface area of sphere.

Language C++

Write a program that takes a radius value from the keyboard then calculates the volume area of sphere and surface area of sphere.

Separate the program into three files:

Main function code: main.cpp.

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

Include 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.

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!