Skip to content
Snippets Groups Projects
Select Git revision
  • db75d796e53a837c740be339bd0e9cd654848b24
  • main default protected
  • variant
3 results

previous-compilation-data.bin

Blame
  • Forked from COUETOUX Basile / FirefighterStarter
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Student.java 2.64 KiB
    import java.util.ArrayList;
    import java.util.List;
    
    /**
     * A students with results.
     */
    
    public class Student {
      private final String firstName;
      private final String lastName;
      private final List<TeachingUnitResult> results;
    
      /**
       * Constructs a student with the specified first name and last name and no associated results.
       *
       * @param firstName the first name of the constructed student
       * @param lastName the last name of the constructed student
       */
    
      public Student(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.results = new ArrayList<>();
      }
    
      /**
       * Add a grade associated to a teaching unit to the results of the student.
       *
       * @param teachingUnitName the name of the teaching unit of the added result
       * @param grade the grade of the added result
       */
      public void addResult(String teachingUnitName, Grade grade){
        // TODO : add code
      }
    
      /**
       * Returns a string representation of the student in the format first name last name.
       * @return a string representation of the student
       */
      @Override
      public String toString() {
        // TODO : change code
        return null;
      }
    
    
      /**
       * Returns the grades of the student.
       *
       * @return the grades of the student
       */
      public List<Grade> getGrades(){
        // TODO : change code
        return null;
      }
    
      /**
       * Returns the average grade of the student.
       *
       * @return the average grade of the student
       */
      public Grade averageGrade() {
        // TODO : change code
        return null;
      }
    
      /**
       * Print via the standard output the name of the student, all results associated to the students and
       * the average grade of the student.
       */