Programming Assignment 17

 

 

Your history professor has just learned that you are a computer whiz.  She has made you an offer you cannot refuse!  If you will write a program to do simple statistical analyses on the scores on the final exam, she will allow you not to take it.  You, of course, cheerfully agree.

 

Your program must work for any size class up to 50 students.  It should do the following things:

 

1.         Read in the scores on the final exam using an end of file loop.  Use a function that also returns the number of scores read.

2.         Use a function to calculate the class average.

3.         Use a function to calculate the class standard deviation as discussed in class.

4.         Use a function to calculate the class maximum.

5.         Use a function to calculate the class minimum.

6.         Use a function to count the number of scores that are above average.

7.         Use a function to print class average, class standard deviation, class maximum, class minimum, and number above average.  Print class average and standard deviation to one decimal digit. 

 

Input

70 90 80 85 65 55 100 70 40 77 66 55 44

 

Output

Class Average =  69.0

Class Standard Deviation =  16.9

Class Maximum =   100

Class Minimum =      40

Number Above Average =    7

 

Functions

int ReadScores(int score[]);

float Average(int score[], int number);

float StdDev(int score[], int number, float average);

int Max(int score[], int number);

int Min(int score[], int number);

int AboveAverage(int score[], int number, float average);

void Printout(float average, float std_dev, int max, int min, int numaboveavg);