Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Tasks - TempWorker The Employee interface lists methods that all children of this interface must have. Task 1 :The TempWorker class inherits from the Employee

Tasks - TempWorker
The Employee interface lists methods that all children of this interface must have.
Task 1:The TempWorker class inherits from the Employee interface.
Task 2: A TempWorker object can be created by giving as an argument a employee's name as a String and the employee's id as an integer. Complete the method public
TempWorker(String nameOfEmp, int id) to complete this task. See the method comments for more detail.
Task 3: The user can calculate the pay due for the period for this student worker. The method will return a double which is the calculation based on pay rate, hours worked,
and overtime. Complete the method public double calcPay(0 to complete this task. The public double calcPay overrides the method of the interface. See the method
comments for more detail.
Task 4: The user will be able to ask for the textual representation of this TempWorker instance. The String includes the employee information and the pay due for the period.
The method will return a String in the form specified in the example below. Complete the method public String toString0 to complete this task. See the method comments
for more detail.
Daffy 125- pay for this period is $660.00
Doris 123- pay for this period is $300.00
Task 5: The TempWorker class has getter and setter for hours worked. Complete the methods public double getHoursWorked0 and public void setHoursWorked(double
hrsWrked) to complete this task. See the methods comments for more detail.
Task 6: The TempWorker class has getter and setter for pay rate. Complete the methods public void setPayRate(double payRate) and public double getPayRate0 to
complete this task. See the methods comments for more detail.
Task 6: The TempWorker class has getter and setter for employee name. Complete the methods public void setNameOfEmp(String nameOfEmp) and public String
getNameOfEmp0 to complete this task. See the methods comments for more detail.
Task 6: The TempWorker class has getter for employee id. Complete the methods public int getId) to complete this task. See the methods comments for more detail.
package assignment;
USE THIS AS TEMPLATE PLEASE public class Staff {
public void addEmployee(Employee worker){
}
/**
*
* @return newline-seperated String of all StudentWorkers
*/
public String toStringOnlyStudentWorkers(){
return "";
}
/**
*
* @return newline-seperated String of all TempWorkers
*/
public String toStringOnlyTempWorkers(){
return "";
}
/**
*
* @return sum of all employees' calcPay
*/
public double calcPayForAllEmployees(){
return -1.0;
}
}
image text in transcribed

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

More Books

Students also viewed these Databases questions

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago

Question

What are the purposes of collection messages? (Objective 5)

Answered: 1 week ago