Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

g++ main.cpp SphereCalc.cpp -Wall -o a.out

We will use this command to compile your code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago