Question: *IN C++* Your assignment is to write a complete C++ program to perform an analysis of quizscores. The input to the program is a sequence
*IN C++*
Your assignment is to write a complete C++ program to perform an analysis of quizscores. The input to the program is a sequence of N quiz scores, followed by -1. Example: 55 98 73 81 84 90 17 -1 Your program may assume there is at least one quiz score in the input sequence, i.e. N > 0. Also assume the quiz scores are valid, i.e. in the range 0..100, inclusive. Finally, assume the sequence is always followed by a -1 to denote the end of the sequence --- do not include the -1 in the analysis. The output from your program is an analysis of the quizscores: the # of scores, average, max, min, and a histogram of A, B, C, D, and F scores (assuming a standard 90-80-70-60 scale). For example, given the input sequence shown above, the output from your program should be the following: ** Quiz Score Analysis ** # scores: 7 Average: 71.1429 Max: 98 Min: 17 90-100: 2 80-89: 2 70-79: 1 60-69: 0 < 60: 2 **END** When producing the output, there is one space following each ":", and each line is followed by a newline. In terms of the analysis, we've discussed in class patterns for counting and summing. What's the pattern for computing maximum and minimum? The typical approach is to declare 2 variables, curMax and curMin. You then initialize these variables to the first input value. As you process the remaining input values, you compare to see if an input value is greater than the current maximum, and if so, update the curMax variable. Likewise, if an input value is less than the current minimum, you update the curMin variable.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
