Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Details for each of the classes in this diagram are: Employee (parent class): Fields firstName (string), lastName (String) and employeeNumber (int). Constructors: Employee() the default

Details for each of the classes in this diagram are: Employee (parent class): Fields firstName (string), lastName (String) and employeeNumber (int). Constructors: Employee() the default constructor (no parameters) that sets the field values to default values. Employee(String, String, int) overloaded constructor that will set the field values to the provided parameter values Methods: getters and setters a getter/setter pair for each field getMonthlyPay() a method that calculates and returns a monthlyPay value as a double. For the generic employee, simply set this to 0.0. getEmployeeType() a method that returns a String indicating the type of employee. For the generic employe returns Employee. toString() returns a string that will describe the current field values, employee type, and monthly pay for the current Employee instance. SalariedEmployee (child class of Employee): This class extends the Employee class. Fields yearlySalary (double) which represents the 12 month salary of the salaried employee. Constructors: SalariedEmployee() the default constructor (no parameters) that sets the field values (including the inherited fields) to default values. SalariedEmployee(String, String, int, double) overloaded constructor that will set the field values (including the inherited fields) to the provided parameter values Methods: getters and setters a getter/setter pair for yearlySalary getMonthlyPay() a method that calculates and returns a monthlyPay value as a double. For the salaried employee, the monthlyPay = yearlyPay / 12. getEmployeeType() a method that returns a String indicating the type of employee. For the salaried employe returns Salaried Employee. toString() returns a string that will describe the current field values, employee type, and monthly pay for the current Salaried Employee instance. HourlyEmployee (child class of Employee): This class extends the Employee class. Fields monthlyHours (int) which represents the total number of hours that the employee has worked during the month hourlyRate (int) which represents the amount per hour worked. Constructors: HourlyEmployee() the default constructor (no parameters) that sets the field values (including the inherited fields) to default values. HourlyEmployee(String, String, int, int, double) overloaded constructor that will set the field values (including the inherited fields) to the provided parameter values Methods: getters and setters a getter/setter pair for monthlyHours and hourlyRate. getMonthlyPay() a method that calculates and returns a monthlyPay value as a double. For the salaried employee, the monthlyPay = monthlyHours times hourlyRate. getEmployeeType() a method that returns a String indicating the type of employee. For the salaried employe returns Hourly Employee. toString() returns a string that will describe the current field values, employee type, and monthly pay for the current Hourly Employee instance. StudentEmployee (child class of HourlyEmployee): This class extends the HourlyEmployee class. Fields no additional fields Constructors: StudentEmployee() the default constructor (no parameters) that sets the field values (including the inherited fields) to default values. StudentEmployee(String, String, int, int, double) overloaded constructor that will set the field values (including the inherited fields) to the provided parameter values Methods: getMonthlyPay() a method that calculates and returns a monthlyPay value as a double. Student employee work is capped at 40 hours per month. For the student employee, if the number of hours worked is less than or equal to 40, then the monthlyPay = monthlyHours times hourlyRate. But, if the number of hours worked is greater than 40, then the monthlyPay = 40 times hourlyRate. getEmployeeType() a method that returns a String indicating the type of employee. For the salaried employe returns Student Employee. toString() returns a string that will describe the current field values, employee type, and monthly pay for the current Student Employee instance. What to do: Create a Java project using Eclipse that includes the Employee classes described above. Also, create a controller class called PayrollReport with a main() method that will: Load an array of employee types. You can just make up the names and values for each employee. Include enough in your array so that all possible employee outcomes are tested. Processes the employee list to report a report like that shown in Figure 2. This report should be displayed in the Eclipse Console.

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions