| Problem: |
- Write a highly modularized C++ program that will grade a set of scores
according to the discussion in
class.
- Store the scores in an array.
- Include a function for each of the following:
- a function that will calculate the mean or average m
- a function that will calculate the standard deviation s
- a function that will grade the scores xi,
i = 1, 2, ..., n
- a function that will do the sorting, (you may use your sorting program and header files)
- Recall the formula for calculating the average m
m = S
xi / n = ( x1 + x2 + ... +
xn ) / n,
i = 1, 2, ..., n
and the standard deviation s of a set of numbers
s = (( n S
xi2 ( S
xi ) 2 ) / ( n ( n 1 ))) ½,
i = 1, 2, ..., n
- Use the intrinsic pre-defined C++ function sqrt.
- The following determines the range of scores for each letter
grade:
| A |
: |
m + 4/3 s |
<= x |
| A |
: |
m + 3/3 s |
<= x < |
m + 4/3 s |
| B+ |
: |
m + 2/3 s |
<= x < |
m + 3/3 s |
| B |
: |
m + 1/3 s |
<= x < |
m + 2/3 s |
| B |
: |
m + 0/3 s |
<= x < |
m + 1/3 s |
| C+ |
: |
m 1/3 s |
<= x < |
m + 0/3 s |
| C |
: |
m 2/3 s |
<= x < |
m 1/3 s |
| C |
: |
m 3/3 s |
<= x < |
m 2/3 s |
| D+ |
: |
m 4/3 s |
<= x < |
m 3/3 s |
| D |
: |
m 5/3 s |
<= x < |
m 4/3 s |
| F |
: |
|
x < |
m 5/3 s |
- Follow the sorting algorithm you did in the sorter program.
|
| |
100, 94, 59, 83, 57, 11, 92, 76, 37, 89, 74, 59, 65, 79, 49, 89, 89, 75,
64, 82, 15, 74, 82, 68, 92, 61, 33, 95, 91, 82, 89, 64, 43, 93, 86, 65, 72,
40, 42, 90, 81, 62, 90, 89, 35, 81, 48, 33, 94, 81, 76, 86, 67, 70, 100, 80,
83, 78, 96, 58
Note: m = 71.47 s = 21.16
Try another set of scores.
|
| Output: |
The output textfile should have the following:
- a summary page consisting of the following:
- mean or average score m,
- standard deviation of the scores s,
- in tabular form, the range of scores for the different grades
( A, A, B+, B, B, C+, C, C, D+, D, F
),
- in tabular form, the tally or the list of the number of scores
receiving an
A, A, B+, B, B, C+, C,
C, D+, D, F.
- a second page consisting of the original unsorted list of scores with
the corresponding grades in tabular form complete with heading, and
- a third page consisting of the descending sorted list of scores with
the corresponding grades in tabular form complete with heading.
|