We are tasked with extending the system that represents a simple classroom grade tracking system. The My Simple Course S

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

We are tasked with extending the system that represents a simple classroom grade tracking system. The My Simple Course S

Post by answerhappygod »

We are tasked with extending the system that represents a simpleclassroom grade tracking system. The My Simple Course System allowsan instructor to manage Students and their Scores in a Course.
Tasks - TempWorker
The Employee interface lists methodsthat all children of this interface must have.
Test your code using the A4TempWorkerDriver class, then submityour code on Gradescope. Fix any issues and resubmit to Gradescopeas many time before the deadline as needed to maximize your scorefor this task.
A4TempWorkerDriver Example Output
Daffy 125 - pay for this period is $660.00660.0300.0Doris 123 - pay for this period is $300.00
Employee.java
package assignment;
public interface Employee {
public double calcPay();public void setHoursWorked(double hrsWrked);public double getHoursWorked();public void setPayRate(double payRate);public double getPayRate();public int getId();public String toString();public boolean equals(Object other);}
USE THIS TEMPLATE FOR TEMPWORKER:
package assignment;
public class TempWorker implements Employee{
/** * @param nameOfEmp * @param id */ public TempWorker(String nameOfEmp, int id){ } /** * Calculate the pay due to the employee basedon rate and hours worked. * Include overtime pay (over 40 hours) incalculation: Hourly pay rate x 1.5 x overtime hours worked. */ @Override public double calcPay() { return -1; }
/** * Setter for hoursWorked */ @Override public void setHoursWorked(double hrsWrked){ }
/** * Getter for hoursWorked * @return hoursWorked */ @Override public double getHoursWorked() { return -1.0; }
/** * Setter for payRate */ @Override public void setPayRate(double payRate) { }
/** * Getter for payRate * @return payRate */ @Override public double getPayRate() { return -1.0; }
/** * Getter for id * @return id */ @Override public int getId() { return -1; }
/** * Getter for nameOfEmp * @return nameOfEmp */ public String getNameOfEmp() { return ""; }
public void setNameOfEmp(String nameOfEmp){ }
/** * @return String that mentions the employee'sname, id, and the pay for the period * e.g.
Daisy 321 - pay for thisperiod is $500.00
*/ public String toString() { return ""; }
}
USE THIS TO CHECK TEMP WORKER:
package assignment;
public class A4TempWorkerDriver {
public static void main(String[]args) { //TempWorker Class TempWorker tmp1 = newTempWorker("Daffy",125); TempWorker tmp2 = newTempWorker("Doris", 123); tmp1.setHoursWorked(50); tmp1.setPayRate(12.0); tmp2.setHoursWorked(20); tmp2.setPayRate(15.0);
System.out.println(tmp1); System.out.println(tmp1.calcPay());
System.out.println(tmp2.calcPay()); System.out.println(tmp2);
}
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply