Assignment (3) - CS 1440
Due February 20

Write a C++ code to compute the surface area, volume, and if applicable the lateral surface area of spheres and/or cylinders.   Your program should ask users whether they want to find the above values for another shape.  By answering 'Y' or 'y' users decide to compute another shape. You also need to ask for number of decimal points, n, (precision) for your output. You will use several functions in your program.  These functions are described below.  You need to determine appropriate type for the function and the parameters. In the case that the input values are not reasonable (example: negative radius or height) your code will display error messages.

Description : This function displays a message regarding what your program will do.  It will display on the screen what the inputs and outputs are and it will explain how the program works.

Sphere_area : This function will compute the surface area of an sphere using the following formula:

Surface Area = 4 * pi * r2
(pi = 3.1415927, r is the radius in cm)

Sphere_volume : This function will compute the volume of a sphere using the following formula:

Sphere Volume  = (4/3) * pi * r3

Total_Cylinder_area : This function will compute the total surface area of a cylinder using the following formula:

Total Surface Area = 2 * pi * r * (r + h)
In this equation r is the radius of the top cylinder top in cm and h is the height of the cylinder in cm.

Lateral_Cylinder_Area : This function will compute the lateral surface area of a cylinder using the following formula:

Lateral Surface Area  = 2 * pi * r* h
Cylinder_volume : This function will compute the volume of a Cylinder using the following formula:
Cylinder Volume  = pi * r2 * h

Print_it : This function will print any number x with n decimal points only.  Both x and n are the parameters passed to this function.    X could be any one of the above values.

To receive full credit, the electronic copy must be submitted as assgn2.C by midnight Tuesday Feb. 20, you are required to submit the hardcopy of your code in class on Wednesday 21.  Please note that documentation and indentation counts for 10 points.  YOUR CODE WILL NOT BE GRADED WITHOUT A HARDCOPY.