Lab Day

Tom Kelliher, CS17

May 6, 1996

We'll skip 2-D arrays.

As promised, sample input data:

100
75
100
80
75
100
70
-1
85
55
60
85
110
70
75
85

Example output:

File name: grades.in
Rejected illegal grade: -1
Rejected illegal grade: 110

Number of accepted grades: 14
Max grade: 100
Average grade: 79.6429
Median grade: 77.5
As: 3
Bs: 4
Cs: 5
Ds: 1
Fs: 1
Standard deviation: 13.5573

File name: grades.out

Suggested list of functions:

  1. int getInputs(int data[], int size); --- Discussed previously. Reject any grades less than 0 or greater than 100.
  2. void putOutputs(int data[], int size); --- Discussed previously.
  3. void sort(int list[], int size); --- Discussed previously.
  4. void swap(int& a, int& b); --- Discussed previously.
  5. int getMax(int data[], int size); --- Work on this yourself.
  6. double getAverage(int data[], int size); --- Work on this yourself.
  7. double getMedian(int data[], int size); --- Assume data is sorted. Two cases:
    1. size is even: Return average of middle two elements.
    2. Otherwise: Return middle element.
  8. void getHistogram(int data[], int size, int& numAs, int& numBs,
    int& numCs, int& numDs, int& numFs); --- Notes:
  9. double getStdev(int data[], int size); --- Notes:


Thomas P. Kelliher
Tue May 7 16:00:18 EDT 1996
Tom Kelliher