Question: 6.4.8 Most Improved Please complete the code in Java Status: Not Submitted 6.4.8: Most Improved Save Submit + Continue RUN CODE | TEST CASES ASSIGNMENT

6.4.8 Most Improved

Please complete the code in Java

6.4.8 Most Improved Please complete the code in Java Status: Not Submitted

6.4.8: Most Improved Save Submit + Continue RUN CODE | TEST CASES

ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted FILES In

Status: Not Submitted 6.4.8: Most Improved Save Submit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted FILES In this exercise, complete the method getMost ImprovedStudent in the Classroom class, as well as the method getExamRange in the Student class. 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. Student.java ClassroomTester.java Classroom.java For example, if the exam scores were 90, 75, and 84, the range would be 90 - 75 = 15. /** The toString method in the Student class will print the student names with their respective grade levels. Then print who the most improved student was after this. Sample output: * Ada Lovelace is in grade: 12 Alan Turing is in grade: 11 The most improved student is Ada Lovelace */ 1 public class Student 2- { 3 private static final int NUM_EXAMS = 4; 4 5 private String firstName; 6 private String lastName; 7 private int gradeLevel; 8 private double gpa; 9 10 private int[] exams; 11 private int numExams Taken; 12 13 14 * This is a constructor. A constructor is a method 15 * that creates an object it creates an instance 16 * of the class. What that means is it takes the input 17 * parameters and sets the instance variables (or fields) 18 * to the proper values. 19 20 * Check out StudentTester.java for an example of how to use 21 * this constructor. 22 23 public Student(String fName, String ZName, int grade) 24 - { 25 firstName fName; 26 lastName I Name; 27 gradeLevel grade; 28 exams = new int[NUM_EXAMS]; 29 numExams Taken = 0; 30 } 31 32 public int getExamRange() { 34 // your code goes here! 35 } 36 37 public String getName() 38 { 39 return firstName + + lastName; 40 } 41 42 public void addExamScore(int score) 43 - 44 exams [numExams Taken] score; 45 numExams Taken++; 46 } 47 48 // This is a setter method to set the GPA for the Student. 33 = Status: Not Submitted 6.4.8: Most Improved Submit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted FILES In this exercise, complete the method getMost ImprovedStudent in the Classroom class, as well as the method getExamRange in the Student class. 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. Student.java ClassroomTester.java Classroom.java For example, if the exam scores were 90, 75, and 84, the range would be 90 - 75 = 15. 1 public class ClassroomTester 2- { 3 public static void main (String[] args) 4- { 5 Classroom c = new Classroom(2); 6 7 Student ada = new Student("Ada", "Lovelace", 12); 8 ada.addExamScore(44); 9 ada.addExamScore(65); 10 ada.addExamScore(77); 11 12 Student alan = new Student("Alan", "Turing", 11); 13 alan.addExamScore(38); 14 alan.addExamScore(24); 15 alan.addExamScore(31); 16 17 // add students to classroom 18 c.addStudentCada); 19 c.addStudentCalan); 20 c.printStudents(); 21 22 Student mostImproved c.getMost ImprovedStudent(); 23 System.out.println("The most improved student is + most Improved.getName()); 24 } 25 } 26 The toString method in the Student class will print the student names with their respective grade levels. Then print who the most improved student was after this. Sample output: Ada Lovelace is in grade: 12 Alan Turing is in grade: 11 The most improved student is Ada Lovelace

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!