Question: Laboratory # 5 Objectives: To use library functions to evaluate equations. To understand nested loop structures, both 'for' and 'while'. Problem 1 : Add a
Laboratory #
Objectives: To use library functions to evaluate equations. To
understand nested loop structures,
both 'for' and 'while'.
Problem:
Add a line that prompts the user to enter the diameter of a sphere.
Read in and store the number into a variable called diameter you
will need to declare any variables that you use
The diameter is twice as long as the radius, so calculate and store the
radius in an appropriately named variable.
The formula for the volume of a sphere is:
Convert the formula to code and add a line which calculates and
stores the value of volume in an appropriately named variable. Use
pow to cube the radius.
Print your results to the screen with an appropriate message.
Problem :
Using for loops control structure write a program segment to print the
following pattern:
Problem :
Repeat problem using while loop control structures.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
