Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the program in Java Student: extends Person numStudents: static int studentID: int coursesTaken: Course[] numCourses Taken: int is Graduate: boolean major:String Ilgenerated //initialize to

Write the program in Java

image

Student: extends Person numStudents: static int studentID: int coursesTaken: Course[] numCourses Taken: int is Graduate: boolean major:String Ilgenerated //initialize to length of 50 //controlled variable //"undeclared" default value + Student() III courses Taken =[], numCourses Taken = 0, is Graduate = false Student(boolean isGraduate) +Student(String major, boolean isGraduate) + Student(String name, int birthYear, String major, boolean isGraduate) +isGraduate(): boolean + getNumCourses Taken(): int + static getNumStudents(): int +getStudentID(): int + getMajor(): String +setlsGraduate(boolean is Graduate): void + setMajor(String major):void +addCourseTaken(Course course): void +addCourses Taken(Course course): void +getCourse Taken(int index): Course + getCourse Taken AsString(int index): String +getAllCourses TakenAsString(): String method lappends course to the end of the existing array appends courses to the end of the existing array // note; index must be verified. Return "null" if invalid // note: index must be verified. Return" if invalid // returns "courseDept-courseNum" // comma separated list of all courses taught Il uses getCourse TakenAsString(int index) as a helper 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, numCourses Taken, getAllCourses TakenAsString() compareTo(Person p): int //use the Comparable interface specification, sort by numCredits

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Programming questions