Question: Use JAVA Part 1 (20 Points) Implement a superclass Person. Make two classes, Student and Instructor, that inherit from Person. A person has a name

Use JAVA

Part 1 (20 Points) Implement a superclass Person. Make two classes, Student and Instructor, that inherit from Person. A person has a name and a year of birth (2 points) A student has a major (2 points) An instructor has a salary (2 points) Write The class declarations (1 point each x 3 = 3 points) The appropriate constructors (2 points each for sub x 1, 1 point for super= 5 points) o One that initializes all the data and utilizes the Super() constructor appropriately. That is, the student constructor will call the super constructor with the appropriate data to initialize the persons instance variables. The (appropriate and overridden) toString methods for all classes. (3 points) o For each class implementation of toString, use (extend) behavior from each super class toStrings method in order to avoid duplicate code (Negative points for duplicate code)! Getters and Setters (Negative points if done wrong) Supply a single test program that tests these classes and methods, including the constructors. (2 points)

Part 2 (20 points) Make a class Employee with a name and salary. (2 points) Make a class Manager that extends Employee. Add an instance variable for type Manager, named department, of type String. (4 points) Make a class Executive inherit from Manager. An Executive has a String that represents their office location. (3 points) The appropriate constructors (2 points each for sub x 1, 1 point for super= 5 points) o One that initializes all the data and utilizes the super() constructor appropriately. That is, the manager constructor will call the super constructor with the appropriate data to initialize the persons instance variables. Same for executive. Supply appropriate toString methods for all classes. (4 points)

o For each implementation of toString, use (extend) behavior from each super class toStrings method in order to avoid duplicate code. (Negative points if not done)

o For example, override the method toString to prints the manager's name, department, and salary.

o Executive toString will include Manager and Employee information as well. Include Getters and Setters (Negative points if done wrong)

Supply a single test program that tests these classes and methods, including the constructors. (2 points) Submission

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 Databases Questions!