Your instructor will assign you one of the problems below. To
solve your problem, write a program that reads the necessary
information to compute and output the indicated values, as
efficiently as possible. Following the pattern in the lab
exercise, first, *design* using OCD; then *code* your
design in C++ using stepwise translation; finally, test your
program thoroughly.

For any of these projects, declare `PI`

as a constant:

const double PI = 3.14159;

Project #3.1: Write a program to find the circumference and area of any circle. The formulas for these quantities are as follows:= 2 * PI *`circumference`

.`uservar`

= PI *`area`

`radius`

^{2}.

Project #3.2: Write a program to find the side surface area and volume of any regular cylinder. The formulas for these quantities are as follows:= 2 * PI *`sideSurfaceArea`

*`radius`

.`height`

= PI *`volume`

`radius`

^{2}*.`height`

Project #3.3: Write a program to find the circumference and area of any regular ellipse. The formulas for these quantities are as follows:= 2 * PI * the square root of (((`circumference`

/2)`height`

^{2}+ (/2)`width`

^{2})/2).= PI *`area`

/2 *`height`

/2.`width`

Project #3.4: Write a program to find the surface area and volume of any sphere. The formulas for these quantities are as follows:= 4 * PI *`surface area`

`radius`

^{2}.= 4/3 * PI *`volume`

`radius`

^{3}.

Turn the following things:

- This grade sheet.
- Your OCD design.
- Your source program.
- The output from three different executions of your program.

Lab Home Page | Lab Exercise

© 2003 by Prentice Hall. All rights reserved.

Report all errors to Jeremy D. Frens.