Answered step by step
Verified Expert Solution
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 :The TempWorker class inherits from the Employee interface.
Task : 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
TempWorkerString nameOfEmp, int id to complete this task. See the method comments for more detail.
Task : 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 to complete this task. The public double calcPay overrides the method of the interface. See the method
comments for more detail.
Task : 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 toString to complete this task. See the method comments
for more detail.
Daffy pay for this period is $
Doris pay for this period is $
Task : The TempWorker class has getter and setter for hours worked. Complete the methods public double getHoursWorked and public void setHoursWorkeddouble
hrsWrked to complete this task. See the methods comments for more detail.
Task : The TempWorker class has getter and setter for pay rate. Complete the methods public void setPayRatedouble payRate and public double getPayRate to
complete this task. See the methods comments for more detail.
Task : The TempWorker class has getter and setter for employee name. Complete the methods public void setNameOfEmpString nameOfEmp and public String
getNameOfEmp to complete this task. See the methods comments for more detail.
Task : 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 addEmployeeEmployee worker
@return newlineseperated String of all StudentWorkers
public String toStringOnlyStudentWorkers
return ;
@return newlineseperated String of all TempWorkers
public String toStringOnlyTempWorkers
return ;
@return sum of all employees' calcPay
public double calcPayForAllEmployees
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started