Write a program that calculates the semester grades of students. The program first reads the number of students, and then reads 6 scores for each student. Each score is an integer, and ranges between 0 and 10. The program displays the number of the easiest quiz and the students' semester grades.
The quizzes are numbered sequentially: 1, 2, 3, 4, 5, and 6. The easiest quiz is the one with the highest total student score. If two or more quizzes have the same total score, the quiz with the smaller number is chosen. For instance, if the 3rd and 6th quizzes have the same total score, the 3rd quiz will be reported.
To calculate a student's semester grade, exclude the highest and lowest quiz scores, then find the average of the remaining four scores.
Program Input
Enter the number of students: 2
Enter the scores for each student:
2 5 10 0 4 7
10 5 6 4 7 9
Program Output
Quiz number 3 is the easiest.
Table of Semester Grades:
Stud1 Stud2
Grades: 4.5 6.8
Your solution should be based on the code template .
Your program must conform the following requirements:
The outputs of your program should behave as in the above example.
You only need to add your code to the function definitions of computeSemesterGrades() and getEasyQuizNumber()
Add your code according to the comments in the function definition.
Do not modify readStudentGrades() and displaySemesterGrades()
Do not modify main() unless you know what you are doing.
Do not modify any cin or cout statements, and do not add any cout statements. Otherwise, your program might not be evaluated properly.
More input-output samples.
Hint:
You can use sort(array, array+6) to sort an array with size 6.