Question: Write a C + + program that takes the radius of a sphere ( a double or floating - point number ) as input and

Write a C++ program that takes the radius of a sphere (a double or floating-point number) as input and then outputs the sphere's:
1. Diameter =(2 x radius)[diameter =2*radius]
2. Circumference =(diameter x pi)[circumference = diameter * math.pi]
3. Surface area =(4 x pi x radius^2)[surface area =4*math.pi*radius*radius]
4. Volume =(4/3 x pi x radius^3)[volume =4/3*math.pi*radius*radius*radius]
Below is an example of the program input and output:
display/introduce (a message of) what the program will accomplish
radius =5
diameter : 10.0
circumference : 31.4159265389793
surface area : 314.159265389793
volume : 523.5987755982989
Document every block of the program codes.
Write a C + + program that takes the radius of a

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!