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

Program #13

We think in generalities, but we live in details.

ALFRED NORTH WHITHEAD

 
 

 

 

 


Write a program that will let a person choose the type of calculation to do from a MENU of three different formulas.

The calculations are as follows; compound interest, standard deviation and work.

 

Have your MENU inside a “do…while” loop so the person could do multiple problems.

The MENU will have a fourth EXIT option.

Sample runs…

   Compound interest: $6878.33

 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Standard deviation is: 5.67

 

 

 

 

 

 

 

 

 

 

 


Compound interest A=p (1+r/n)nt.  Ask for principal (initial amount), rate (APR, rate of interest), periods per year, and time (in years).

 

Variation = ((x1-mean) 2+(x2-mean)2 +… (x5-mean)2 /5)  The standard deviation is the sum of the square of the differences divided by the number of scores.  Deviation= sqrt(variation).  Ask five scores, calculate average, calculate variation, then standard deviation.

 

Work= mass*gravity (height (initial)-height (final)).  Use 9.8 for gravity.  Ask mass (in kg) and two heights (in meters)

*For do… while

do{  …MENU and calculations… }while (ch! = 4);