Addtional Java Cls Program5
Addtional Java Cls Program5
Student ID Score
1 [10,20,10]
2 [10,20,11]
import java.util.*;
int totalScore = 0;
totalScore += score;
studentTotalScores.put(studentId, totalScore);
}
System.out.println("Student ID\tTotal Score");
Summary:
The program first creates a map studentScores with student IDs as keys and lists of scores as values. It
then creates an empty map studentTotalScores to store the total score of each student.
The program then loops through the entries of studentScores, calculates the total score for each
student, and adds the result to the studentTotalScores map.
Finally, the program prints out the total score for each student in a table format with columns for
Student ID and Total Score.