Activity 10.4.1.
Complete method
highestScoringStudent
below.
public class TestResults
{
private List<StudentAnswerSheet> sheets;
/**
* Precondition: sheets.size() > 0; all answer sheets in sheets have the same
* number of answers
*
* @param key the list of correct answers represented as strings of length one
* Precondition: key.size() is equal to the number of answers in each of
* the answer sheets in sheets
* @return the name of the student with the highest score
*/
public String highestScoringStudent(List<String> key)
{
/* to be implemented in part (b) */
}
// There may be fields, constructors, and methods that are not shown.
}
TestResults
method highestScoringStudent
, which returns the name of the student who received the highest score on the test represented by the parameter key
. If there is more than one student with the highest score, the name of any one of these highest-scoring students may be returned. You may assume that the size of each answer sheet represented in sheets
is equal to the size of key
.
highestScoringStudent
below.
highestScoringStudent
method.
highestScoringStudent
below.