Question: Student: extends Person numStudents: static int studentID: int / / generated coursesTaken: Course [ ] / / initialize to length of 5 0 numCoursesTaken: int

Student: extends Person
numStudents: static int
studentID: int //generated
coursesTaken: Course[]//initialize to length of 50
numCoursesTaken: int //controlled variable
isGraduate: boolean
major:String //undeclared default value
Student()/// coursesTaken =[], numCoursesTaken =0, isGraduate = false
Student(boolean isGraduate)
Student(String major, boolean isGraduate)
Student(String name, int birthYear, String major, boolean isGraduate)
isGraduate():boolean
getNumCoursesTaken(): int
static getNumStudents(): int
getStudentID(): int
getMajor(): String
setIsGraduate(boolean isGraduate): void
setMajor(String major):void
addCourseTaken(Course course): void //appends course to the end of the existing array
addCoursesTaken(Course [] courses): void //appends courses to the end of the existing array
getCourseTaken(int index): Course // note: index must be verified. Return null if invalid
getCourseTakenAsString(int index): String // note: index must be verified. Return if invalid
// returns courseDept-courseNum
getAllCoursesTakenAsString(): String // comma separated list of all courses taught
// uses getCourseTakenAsString(int index) as a helper method
equals(Object obj): boolean //all attributes inherited+local must match for 2 Student objects to be considered equal
toString(): String // Student: studentID: %04d | Major %20s |%14s | Number of Courses Taken: %3d | Courses Taken: %s, studentID, major, Graduate/Undergraduate, numCoursesTaken, getAllCoursesTakenAsString()
compareTo(Person p): int //use the Comparable interface specification, sort by numCredits

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!