Skip to content
Snippets Groups Projects
Commit 4acef41a authored by Lou's avatar Lou
Browse files

sarting class cohort

parent 147f5b5d
No related branches found
No related tags found
No related merge requests found
Pipeline #16047 passed
No preview for this file type
No preview for this file type
public class App {
public static void main(String[] args){
// TODO add code
Student toto = new Student("Toto", "Totoro");
Grade toto_UEpro = new Grade(0.0);
Grade toto_Sport = new Grade(5.0);
toto.addResult("UE_pro", toto_UEpro);
toto.addResult("toto_Sport", toto_Sport);
toto.printResults();
}
}
......@@ -24,7 +24,7 @@ public class Cohort {
* @param student the student to be added to the cohort
*/
public void addStudent(Student student){
// TODO : add code
this.students.add(student);
}
/**
......@@ -32,8 +32,7 @@ public class Cohort {
* @return the list of students of the cohort.
*/
public List<Student> getStudents(){
// TODO : change code
return null;
return this.students;
}
/**
......@@ -50,7 +49,13 @@ public class Cohort {
*/
@Override
public String toString() {
// TODO : change code
String textToReturn = "";
System.out.println(this.name + "\n");
for (Student student : this.students) {
System.out.println("\n");
student.printResults();
}
return null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment