/** * Returns an array list of studens in the section. * * @return An array list containing all the students in the section. */ public ArrayList<Student> getStudents() { ArrayList<Student> toReturn = new ArrayList<Student>(); for (int i = 0; i < students.getSize(); i++) { toReturn.add(students.get(i)); } return toReturn; }
/** * Returns the average score for this section based on the students in this section. * * @return The average score for the section as a double. */ public double getAverage() { double total = 0; for (int i = 0; i < students.getSize(); i++) { total += students.get(i).getAverage(); } return total / students.getSize(); }
/** * Adds a single student to this section. * * @param toAdd The student to add to this section/ */ public void addStudent(Student toAdd) { students.addStudent(toAdd); }