Question: Consider a system for processing student test scores. The following class will be used as part of this system and contains a student's name and

 Consider a system for processing student test scores. The following class

Consider a system for processing student test scores. The following class will be used as part of this system and contains a student's name and the student's answers for a multiple-choice test. See the API for the StudentAnswerSheet class which has already been coded and tested. You cannot change the StudentAnswerSheet class. StudentAnswerSheet API // constructor public StudentAnswerSheet (String name, char [] studentAnswers) V/ accessors public String getName ( public double getScore (char [] answerkey) // returns the student's score Consider now a class that represents the test results for a collection of students that took a multiple choice test. Add the following method to the TestResults class: public String highestScoringStudent(char( answer Key) - returns the names of a highest scoring students in this TestResults collection according to the "answer Key". If more than one student has the highest score, return all their names concatenated in one long String. If no students are in the collection, return an empty String. public class TestResults { private StudentAnswer Sheet (1 students; private int count=0; private static final int DEFAULT_SIZE=10; public TestResults (int size) 1 if (size>0) students=new StudentAnswerSheet (size]; else students-new Student AnswerSheet (DEFAULT_SIZE]: count=0; 1 public boolean addStudentAnswer Sheet (StudentAnswerSheet x) { boolean inserted-false; if (x!=null && count students.length) { students [count] =x; count++; inserted=true; 1 return inserted; 1 public String highest ScoringStudent (chart) answerkey) { // ADD YOUR CODE HERE } } ALT+F10 Pr ALT+FN+F10 (Mac)

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!