Summarizing Problem

advertisement
Summarizing Problem
Course-Students Problem
Implement classes: Course, Student, CoopStudent, and NonCoopStudent as
follows.

A Student has a name, a date of birth, and an ID. He has also a list of
quizzes marks implemented using a LinkedList. A CoopStudent has, in
addition, a Coop mark while a NonCoopStudent doesn't. Provide
necessary accessor and mutator methods as well as the two following
methods:
1.
2.

addQuizz to add the mark when a student passes a quiz. We assume that all
quizzes are marked out of 100. If the mark supplied is not in the range 0-100,
the program should throw an exception.
getGPA to compute and return the GPA. The GPA is simply the average of all
quizzes for a NonCoopStudent and the average of all quizzes as well as the
Coop mark for a CoopStudent.
A Course has a name, an instructor name, and a set of Students
implemented as a TreeSet. Provide the following methods:
1.
2.
3.
4.
5.
addStudent : adds a student to the course.
withdrawStudent: withdraws a Student from the course. If the Student is not
in the course, the program should throw an exception.
getResults: returns an ArrayList of Result objects. Result is a class with two
data members: ID and GPA.
bestStudent: returns the Student with the highest GPA.
averageGPA: returns the average GPA of the course.
Download