package employeeStuff; public class TemporaryEmployee extends Employee { private int hours; private double rate; /** * constructor from parameters */ public TemporaryEmployee(String id,String first, String last, int hours, double rate) { super(id,first,last); this.hours = hours; this.rate = rate; } // access functions /** * @return hours */ public int getHours() { return hours; } /** * @return rate */ public double getRate() { return rate; } // mutator functions /** * sets the hours */ public void setHours(int h) { hours = h; } /** * sets the rate */ void setRate(double r) { rate = r; } // calculation function /** * @return the pay check calculation, hours*rate */ public double pay() { return hours * rate; } /** * overrides toString() from the employee class * @return data values as a String */ public String toString() { return super.toString() + "\nTemporaryEmployee:\nHours: " + hours + " Rate: " + rate + " "; } } // end TemporaryEmployee