Home / Expert Answers / Computer Science / need-help-fixing-my-java-code-driver-schooldb-i-cant-put-in-my-entire-code-because-it-wont-fit-but-pa726

(Solved): need help fixing my java code Driver_SchoolDB i cant put in my entire code because it wont fit but ...



need help fixing my java code Driver_SchoolDB i cant put in my entire code because it wont fit but can you help me Course isGraduateCourse: boolean courseNum: int courseDept: String numCredits: int Course(boolean isGraduateCourse, int courseNum, String courseDept, int numCredits) isGraduateCourse(): boolean getCourseNum(): int getCourseDept(): String getNumCredits(): int getCourseName: String //return String of “U” or “G” + courseDept + courseNum equals(Object obj): boolean //all attributes must match for 2 Course objects to be considered equal toString(): String //”Course: %3s-%3d | Number of Credits: %02d | Graduate/Undergraduate”, courseDept, courseNum, numCredits, isGraduateCourse compareTo(Course c): int //use the Comparable interface specification. Sort by courseNum Person name: String birthYear: int Person() // name = “”, birthYear = 0 Person(String name, int birthYear) getName():String getBirthYear():int setName(String name): void setBirthYear(int year): void equals(Object obj): boolean //all attributes must match for 2 Person objects to be considered equal toString(): String //”Person: Name: %30s | Birth Year: %4d”, name, birthYear compareTo(Person p): int //use the Comparable interface specification. Sort by birthYear. Employee extends Person deptName: String numEmployees: static int employeeID: int //generated Employee() // deptName = “”, employeeID computed Employee(String deptName) // employeeID computed Employee(String name, int birthYear, String deptName) // employeeID computed getDeptName(): String static getNumEmployees(): int getEmployeeID(): int setDeptName(String deptName): void equals(Object obj): boolean //all attributes inherited+local must match for 2 Employee objects to be considered equal toString(): String //” Employee: Department: %20s | Employee Number: %3d”, deptName, employeeID compareTo(Person p): int //use the Comparable interface specification. Sort by employeeID Faculty extends Employee coursesTaught: Course[ ] // you can assume that the maximum number of courses a faculty has // taught cannot exceed 100 numCoursesTaught: int //controlled variable isTenured: boolean Faculty() // coursesTaught = [], numCoursesTaught = 0, isTenured = false Faculty(boolean isTenured) // coursesTaught = [], numCoursesTaught = 0, this.isTenured = isTenured Faculty(String deptName, boolean isTenured) Faculty(String name, int birthYear, String deptName, boolean isTenured) isTenured():boolean getNumCoursesTaught(): int setIsTenured(boolean isTenured): void addCourseTaught(Course course): void //appends course to the end of the existing array addCoursesTaught(Course [] courses): void //appends courses to the end of the existing array getCourseTaught(int index): Course // note: index must be verified. Return “null” if invalid getCourseTaughtAsString(int index): String // note: index must be verified. Return “” if invalid // returns “courseDept-courseNum” getAllCoursesTaughtAsString(): String // comma separated list of all courses taught // uses getCourseTaughtAsString(int index) as a helper method equals(Object obj): boolean //all attributes inherited+local must match for 2 Faculty objects to be considered equal toString(): String //” Faculty: %11s | Number of Courses Taught: %3d | Courses Taught: %s”, Is Tenured/Not Tenured , numCoursesTaught, getAllCoursesTaughtAsString() compareTo(Person p): int // use the Comparable interface specification, sort by // numCoursesTaught GeneralStaff: extends Employee duty: String GeneralStaff() // duty = “” GeneralStaff(String duty) GeneralStaff(String deptName, String duty) GeneralStaff(String name, int birthYear, String deptName, String duty) getDuty(): String equals(Object obj): boolean //all attributes inherited+local must match for 2 Staff objects to be considered equal toString(): String //” GeneralStaff: Duty: %10s”, duty Note: do not override the inherited compareTo from the Employee class (use as is) 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 c



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe