Example Scenario
Dr. Dela Cruz teaches three sections of his Intro to programming class.
He has
12 students in section 1, 8 students in section 2, and 10 students in section 3.
You will find the following exam scores of each student in every section:
• Section1 - 80, 85, 90, 85, 94, 93, 80, 80, 93, 82, 80, 82 (12 integer scores)
• Section2 - 85, 90, 87, 88, 90, 92, 88, 92 (8 integer scores)
• Section3 - 90, 92, 83, 85, 88, 90, 93, 80, 82, 81 (10 integer scores)
Dynamic Exam Scores Calculator:
Create an application that can dynamically accept a number of sections, the number of students in a section, and can stores their exam scores then
determine the following:
1. The average exam score for each individual section
2. The average exam score for all the students in all sections
3. The highest exam score among all sections.
4. The lowest exam score among all sections.
5. The exam score that appears most frequently among all three sections
(Mode).
6. The middle exam score among all three sections (Median).
Note: The generation of the above task should be carried out by value-returning
methods.
Example Program output:
Enter the number of section: 3
Enter the number of students in section 1: 12
Enter the number of students in section 2: 8
Enter the number of students in section 3: 10
Enter the exam score of student number 1 in section 1: 80
Enter the exam score of student number 2 in section 1: 85
Enter the exam score of student number 3 in section 1: 90
…
Enter the exam score of student number 12 in section 1: 82
Enter the exam score of student number 1 in section 2: 85
Enter the exam score of student number 2 in section 2: 90
Enter the exam score of student number 3 in section 2: 87
…
Enter the exam score of student number 8 in section 2: 92
Enter the exam score of student number 1 in section 3: 90
Enter the exam score of student number 2 in section 3: 92
Enter the exam score of student number 3 in section 3: 83
…
Enter the exam score of student number 10 in section 3: 81
The average score in section 1: 80.33
The average score in section 2: 89.00
The average score in section 3: 86.40
The average score in all sections: 86.66
Highest score in section 1: 94
Highest score in section 2: 92
Highest score in section 3: 93
Highest score in all sections: 94
The lowest score in section 1: 80
The lowest score in section 2: 85
The lowest score in section 3: 81
The lowest score in all sections: 80
Mode: 80, 90
Median: 87.50