make sure that you initialize the other instance variables appropriately
assign each student a unique id
Accesor Methods
public int getId() //returns a student's id
public String getName() //@returns the concatenation ofname
public void printCourses() //this prints a comma separated list of each course and its corresponding current grade. Output might look so meting like:
"English: 88, Math: 77, History " 91"
public void dropClass(String courseTitle) //this remove courseTitle from currentCourses and it also removes its corresponding grade from currentGrades.
public void updateGrade(String course, double grade) //
public double getTermAve() //returns the average of your current courses
public double getCumulative() //returns the average of all prior courses
public String toString() //follows conventions of the toString() method
boolean equals(Student other) //returns true if other has the same
id
public int compareTo(Student other ) //returns the difference between this object and other's cumulative average
Mutator Methods
public void addCourse(String course) //@ adds course to currentCourses and adds -1 to currentGrades
public void dropOut() // clears currentCourses and currentGrades
public void graduate() // calls completeTerm() and sets the currentCourses and currentGrades to null
public void completeTerm()//
This method is called upon completion of the current semester. Therefore all of the currentCourses should be added to priorCourses.
currentCourses should be reset to an empty ArrayList
Do the same thing with currentGrades and priorGrades.
Also, you should update cumulativeAverage and set currentAverage to -1
Other Methods
public Student clone()// this returns a new Student that is a clone of the current student. Ie all of the data for the cloned student should the same
Class 2 School.
Static Variables
private static int nextID =0;
Instance Variables
private String districtName
private int schoolId
private ArrayList<Student> studentBody
Constructors
public School( )
initialize instance variables and assign school a unique id
Accesor Methods
public int getStudents() //returns the number of students in school
public ArrayList<Student> getStudents() ; //returns studentBody
public double getMean(int gradeLevel) //this returns average of all students whose gradeLevel is grade
public ArrayList<Student> getStudentByName(String name) //returns an ArrayList of Students whose names match the paramaters
public Student getStudentById(int studentId) //returns the student whose id is id
public String toString() //you know the deal
public boolean equals(School s) // returns true if the schools id is equal
public int compareTo(School other) //returns the difference (as an int) between the number of students in this object and other
public ArrayList<Student> getHonorRoll() //returns an arraylist of student's whose cumulative average is at least 90.
** Extra Credit
1) add a compareTo method to the student class that compares their cumulative averages
2) add the following method to School
ArrayList<Student> sort() //this method returns the student body ordered by their cumulative average. Note: You must use the student method compareTo() to do this. Also, you may not use any helper utility methods to complete this method. Among other things ( Stella) , you may not use any of the static methods of the Collections or Arrays classes.
Mutator Methods
public void addStudent(Student s) //adds s to studentBody
public void dropStudent(Student s)//removes student from studentBody
public void dropStudent(String first, String name)//removes student from studentBody