Question: Taking our Student and Classroom example from earlier, you should fill in the method getMostImprovedStudent, as well as the method getExamRange. The most improved student
Taking our Student and Classroom example from earlier, you should fill in the method getMostImprovedStudent, as well as the method getExamRange. The most improved student is the one with the largest exam score range.
To compute the exam score range, you must subtract the minimum exam score from the maximum exam score.
For example, if the exam scores were 90, 75, and 84, the range would be 90 - 75 = 15.
public class ClassroomTester extends ConsoleProgram { public void run() { Classroom c = new Classroom(2); Student ada = new Student("Ada", "Lovelace", 12); ada.addExamScore(44); ada.addExamScore(65); ada.addExamScore(77);
Student alan = new Student("Alan", "Turing", 11); alan.addExamScore(38); alan.addExamScore(24); alan.addExamScore(31);
// add students to classroom c.addStudent(ada); c.addStudent(alan); c.printStudents(); Student mostImproved = c.getMostImprovedStudent(); System.out.println("The most improved student is " + mostImproved.getName()); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
