public void Leave(Student studentToLeave) { if (this.students.Count==0) { throw new Exception("No students added."); } this.students.Remove(studentToLeave); }
public void Join(Student newStudent) { if (this.students.Count==30) { throw new IndexOutOfRangeException("Cannot add more than 30 students."); } this.students.Add(newStudent); }