Question: Objectives: To use library functions to evaluate equations. To understand nested loop structures, both for and while . Problem 1 : 1 . Add a

Objectives: To use library functions to evaluate equations. To understand nested loop structures,
both for and while.
Problem1:
1. Add a line that prompts the user to enter the diameter of a sphere.
2. Read in and store the number into a variable called diameter (you will need to declare any
variables that you use).
3. The diameter is twice as long as the radius, so calculate and store the radius in an appropriately
named variable.
4. The formula for the volume of a sphere is: V =4/3*3
Convert the formula to C++ code and add a line which calculates and stores the value of volume in an
appropriately named variable. Use pow(x,y) to cube the radius.
5. Print your results to the screen with an appropriate message.

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!