Class Cohort


public class Cohort extends Object
A group of students.
  • Constructor Details

    • Cohort

      public Cohort(String name)
      Constructs a cohort with a name equals to the specified name and no students.
      Parameters:
      name - the name of the constructed Cohort
  • Method Details

    • addStudent

      public void addStudent(Student student)
      Add the specified student to the students of the cohort.
      Parameters:
      student - the student to be added to the cohort
    • getStudents

      public List<Student> getStudents()
      Returns the list of students of the cohort.
      Returns:
      the list of students of the cohort.
    • printStudentsResults

      public void printStudentsResults()
      Print via the standard output the name of the cohort and all results associated to the students with their average grade.
    • toString

      public String toString()
      Returns the name of the cohort.
      Overrides:
      toString in class Object
      Returns:
      the name of the cohort