How can I remove a student from the course by using the drop method down below? I tried by accessing the roll book for the course parameter. But I do not how to remove the student id from the roll book.
public static class Student {
private int studentID;
private String first;
private String last;
private int credits;
private boolean graduate;
public Student(int id, String first, String last, boolean graduate) {
this.studentID = id;
this.first = first;
this.last = last;
this.graduate = graduate;
}
public int getID() { return studentID; }
public String getFirstName() { return first; }
public String getLastName() { return last; }
public int getCredits() { return credits; }
public boolean isGraduate() { return graduate; }
public void setCredits(int credits) { this.credits = credits; }
public String toString() { return "[" + studentID + "] " + first + " " + last; }
public boolean isEnrolled(Course c) {
return (c.findRollBookEntry(this.getID()) != null);
}
public void drop(Course c) {
for(int i = 0; i<c.getRollBook().length; i++){
c.findRollBookEntry(i).getStudent();
}
}
}