/Student-Grade

A Student has a name and an ArrayList of grades (Doubles) as instance variables. Write a class named Classroom which manages Student objects.

Primary LanguageJava

Student-Grade

A Student has a name and an ArrayList of grades (Doubles) as instance variables.

Write a class named Classroom which manages Student objects.

You will provide the following:

public Classroom() a no-argument constructor.

public void add(Student s) adds the student to this Classroom (to an ArrayList)

public String hasAverageGreaterThan(double target) gets the name of the first student in the Classroom who has an average greater than the target or the empty string. Do not use break. Do not return from the middle of the loop. Use a boolean flag if you need to terminate early.

public ArrayList getStudents() gets an ArrayList containing the names of all the Students in this Classroom.

public Student bestStudent() gets the Student with the highest average in this classroom or null there are no students

public String toString() gets a string represent ion using ArrayList's toString method