ENGR 021 Fall 2014 Assignment #1

DUE: Monday, September 15, 2014 6:30 PM at Start of Class

Rules:



1. Pipe Information


Write a C++ program that calculates the volume and the surface area of a pipe by asking the user for the radius and a length.
The formulas are V = (pi) r r L and A = 2 (pi) r L.  "Echo" this input back to the user and print the radius, height, volume, and surface area labeling each. 
Show runs for at least three different pipes.
Example run might look like this, but does not have to look exactly like it:

THIS PROGRAM CALCULATES INFORMATION FOR A PIPE OR TUBE.
Give me a radius, then a length, then press enter:  2.5 15

OK for pipe of radius = 2.5, length = 15:

Volume = 294.5
Surface Area = 235.6
Thank you for running this program!

2. Average of Seven Real Numbers


Develop a simple C++ program that reads in seven real numbers, prints the seven numbers in the order that they were entered, one line for each number with label.
It then prints their average on another line.  Show runs for two sets of widely different numbers.
Example:

THIS PROGRAM FINDS THE AVERAGE OF SEVEN REAL NUMBERS.
Input numbers, separated by a space, then enter:

 9.3 -11.5 143.6 5.75 -6.007 0.314 22.2

Your inputs:

1st number: 9.3
2nd number: -11.5
3rd number: 143.6
4th number: 5.75
5th number: -6.007
6th number: 0.314
7th number: 22.2

The average of the seven numbers is: 23.38
Thank you. Enjoy your day.

3. Elapsed Time


Write a C++ program that will provide the time difference between two clock times of day that the user inputs.
To keep it simple, assume for this problem that both times given are both AM or both PM.  Show runs for three sets of widely different times.
Typical session:


Enter the time A in hours and minutes, separated by a space: 2 55
Enter the time B in hours and minutes, separated by a space: 5 40

Thank you. The difference in clock time is 2 hours 45 minutes.