Site hosted by Angelfire.com: Build your free website today!

BONUS NUMBER ONE

 

*This program will calculate surface area of two different figures.

* You will ask for input of radius and height of a cone.

* You will ask for input of radius and height of a cylinder.

 

*The program will first print out the surface area of a right circular cylinder, then print out the surface area of a right circular cone.

* When the program runs, the output screen will have displayed at the top a heading like this…

 

                                                Surface Area Data Entry

 

PLEASE ENTER RADIUS IF CONE: 4.57

PLEASE ENTER HEIGHT OF CONE: 16.9

PLEASE ENTER RADIUS OF CYLINDER: 8.6

PLEASE ENTER HEIGHT OF CYLINDER: 12.82

 

The results will look like this…

 

                                                Surface Area Data Entry

 

FIGURE            Radius              Height               Surface Area

Cylinder            8.6                    12.82                1157.438

Cone                 4.57                  16.9                  316.96116

 

Write the program steps in this order…

1.       Print input screen

2.       Ask all 4 questions

3.       Clear screen

4.       Calculate data

5.       Print output

 

The 7 identifiers (6 variables and const for pi) that you will need are:

            -hgt_cn, hgt_cy (float)

            -rad1, rad2 (float)

            -sur_cn, sur_cy (float)

 

cone=pi * r * r + pi * r *

 

cylinder= 2 * pi * r^2 + 2 * pi * r * h