package studentDB; /** * Undergraduate Student class * An ungraduate student is a form of student, with * a list of courses in which he/she is enrolled. */ public class UndergraduateStudent extends Student { private CourseList courses = new CourseListImpl(); /** * Creates an undergraduate student with no name, * student number or courses. */ public UndergraduateStudent () { } /** * @param name The name of the undergraduate student * @param studentNumber The student number of the undergraduate student * @param thesisTitle The thesis title of the undergraduate student */ public UndergraduateStudent ( String name, int studentNumber, CourseList courses) { super (name, studentNumber); this.courses = courses; } /** * Sets the student's courses to the given list. * @param courses The courses in which the student is enrolled */ public void setCourses (CourseList courses) { this.courses = courses; } /** * Returns the list of courses in which the student is enrolled. * @return The courses in which the student is enrolled. */ public CourseList getCourses () { return courses; } /** * Converts information about an undergraduate student into a string * form suitable for printing. * @return Information describing graduate student. */ public String toString () { return super.toString() + "; Courses: " + courses; } }