Programming Language: JAVA
- Implement interface and inheritance
- Implement polymorphism
Payroll System Using Inheritance and Polymorphism 1. Implement an interface called Employeelnfo with the following constant variables: FACULTY-MONTHLY-SALARY = 5000.00 STAFF-MONTHLY-HOURS-WORKED=150 2. Implement an abstract class Employee with the following requirements: Attributes o last name (String) o first name (String) o ID number (String) o Sex -M or F o Birth date Use the Calendar Java class to create a date object Default argument constructor and argument constructors. e Public methods o toString returning a string with the following format: ID Employee number Employee name: Birth date:_ o mutators and accessors o abstract method monthlyEarning that returns the monthly carning 3. Implement a class called Staff extending from the class Employee with the following requirements: Attribute o Hourly rate Default argument and argument contructors . Public methods o get and set o The method Earning returns monthly salary (hourly rate times 160) o toString returning a string with the following format: ID Employee number Employee narme: Birth date:_ Full Time Monthly Salary Implelment a class Education with the following requirements: .Attributes o Degree (MS or PhD) o Major (Engineering, Chemistry, English, etc ..) o Research (number of researches) Default argument and argument constructors Public methods o get and set Implement a class Faculty extending from the class Employee with the following requirements: Attributes o Level (Use enum Java) "AS": assistant professor "AO": associate professor "FU": professor o Education object Default argument and argument constructor Public methods o mutators and accessors o The method monthlyEarning returns monthly salary based on the faculty's level AS faculty monthly salary AO 1.5 times faculty monthly salary FU -2.0 times faculty monthly salary o toString returning a string with the following format: ID Employee number :- - name: Birth date: XXXXX Professor where XXXXX can be Assistant, Associate or Full Monthly Salary:_ Implement a class called Partime extending from the class Staff with the following requirements: Attributes o Hours worked per week .Default argument and argument constructors Public methods o mutators and accessors The method monthlyEa ning returns monthly salary The monthly salary is equal to hourly rate times the hours worked in four weeks. o toString returning a string with the following format: ID Employee number:-- - - Employee name:_ Birth date:_ Hours works per month: Monthly Salary_ mplement a test driver program that creates a one-dimensional array of class Employee to store the objects Staff, Faculty and Partime. Using polymorphism, display the following outputs: a. Employee information using the method toString . Staff . Faculty . Part-time b. Total monthly salary for all the part-time staff c. Total monthly salary for all employees d. Display all employee information ascending by employee id using interface Comparer e. Display all employee information descending by last name using interface Comparable f. Duplicate a faculty object using clone. Verify the duplication. Test Data Staff 1.Last name: Allern First name: Paita ID: 123 Sex: M Birth date: 2/23/59 Hourly rate: S50.00 2. Last name: Zapata First Name: Steven ID: 456 Sex: F Birth date: 7/12/64 Hourly rate: S35.00 3. Last name:Rios First name:Enrique ID: 789 Sex: M Birth date: 6/2/70 Hourly rate:$40.00 Faculty 1. Last name: Johnson First name: Anne ID: 243 Sex: F Birth date: 4/27/62 Level: Full Degree: Ph.D Major: Engineering Rescach: 3 2. Last name: Bouris First name: William ID: 791 Sex: F Birth date: 3/14/7 Level: Associate Degree: Ph.D Major: English Reseach: 1 3. Last name: Andrade First name: Christopher ID: 623 Sex: F Birth date: 5/22/80 Level: Assistant Degree: MS Major: Physical Education Rescarch: 0 Part-time 1.Last name: Guzman First name: Augusto ID: 455 Sex: F Birth date: 8/10/77 Hourly rate: $35.00 Hours worked per week: 30 2.Last name: Depiro First name: Martin ID: 678 Sex: F Birth date: 9/15/87 Hourly rate: $30.00 Hours worked per week:15 3. Last name: Aldaco First name: Marque ID: 945 Sex: M Birth date: 11/24/88 Hourly rate: $20.00 Hours worked per week: 35