Question: Payroll System Using Inheritance and Polymorphism in Java 1. Implement an interface called EmployeeInfo with the following constant variables: FACULTY_MONTHLY_SALARY = 6000.00 STAFF_MONTHLY_HOURS_WORKED = 160

Payroll System Using Inheritance and Polymorphism in Java 1. Implement an interface called EmployeeInfo with the following constant variables:

FACULTY_MONTHLY_SALARY = 6000.00

STAFF_MONTHLY_HOURS_WORKED = 160

2. Implement an abstract class Employee with the following requirements:

Attributes

last name (String)

first name (String)

ID number (String)

Sex - M or F

Birth date - Use the Calendar Java class to create a date object

Default argument constructor and argument constructors.

Public methods

toString - returning a string with the following format: ID Employee number :_________ Employee name: __________ Birth date: _______

mutators and accessors

abstract method monthlyEarning that returns the monthly earning.

3. Implement a class called Staff extending from the class Employee with the following requirements:

Attribute

Hourly rate

Default argument and argument constructors

Public methods

get and set

The method monthlyEarning returns monthly salary (hourly rate times 160)

toString - returning a string with the following format: ID Employee number :_________ Employee name: __________ Birth date: _______ Full Time Monthly Salary: _________

Implement a class Education with the following requirements:

Attributes

Degree (MS or PhD )

Major (Engineering, Chemistry, English, etc ... )

Research (number of researches)

Default argument and argument constructors.

Public methods

get and set

Implement a class Faculty extending from the class Employee with the following requirements:

Attributes

Level (Use enum Java) "AS": assistant professor "AO": associate professor "FU": professor

Education object

Default argument and argument constructor

Public methods

mutators and accessors

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

toString - returning a string with the following format: ID Employee number :_________ Employee 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

Hours worked per week

Default argument and argument constructors

Public methods

mutators and accessors

The method monthlyEarning returns monthly salary. The monthly salary is equal to hourly rate times the hours worked in four weeks.

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 descending by employee id using interface Comparable e. Display all employee information ascending by last name using interface Comparer f. Duplicate a faculty object using clone. Verify the duplication.

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!