1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
/**
* Constructor for objects of class TutorGroup
*/
public TutorGroup()
{
super();
this.students = new TreeMap<String,Student>();
}
/**
* Adds a number of students to the tutorgroup/ La method ci-dessous est deja prete pour cet exercise, je n'ai rien a changer ici */
public void populate()
{
String [] nameArray = {"Rebecca", "Anne", "Kiran", "Lee", "Haruki", "Tony", "Hanif", "Dylan", "Katja", "Ana"};
Integer [][] tmaScores = {{46, 75, 64, 0},{92, 89, 94, 85},
{71, 80, 75, 80},{97, 95,80, 81},
{55, 65, 60, 60},{96, 93, 0, 88},
{69, 75, 64, 47},{80, 81, 92, 65},
{85, 92, 0, 0},{83, 89, 90, 35}};
Integer [] examScores = {37, 86, 65, 85, 48, 87, 55, 72, -1, 70};
for (int count = 0; count < nameArray.length; count++)
{
Student aStudent = new Student(nameArray[count]);
aStudent.setTmaMarks(Arrays.asList(tmaScores[count]));
aStudent.setExamMark(examScores[count]);
students.put(nameArray[count], aStudent);
}
}
/**
* Displays the names and marks for the students
* in the tutor group in the Display Pane/ La method ci-dessous line 3 est celle que je dois completer pour l'exercise
*/
public void displayTutorGroup()
{
Map<String, String> marks = new HashMap<String, String>();
for (String name: this.students.keySet()) // line 1
{
System.out.println("Student " + name + ":"); // line 2
marks.displayMarks(); // line 3
System.out.println();
}
} |
Partager