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