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

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 12E
icon
Related questions
Question

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr