// NAME: Liane Nakamura // STUDENT ID: 25806927 // Hourly Employee subclass of Employee public class EmployeeHourly extends Employee { private int wage; public EmployeeHourly (String name) { super(name); } public EmployeeHourly (String name, int wage) { super(name); this.wage = wage; } public Paycheck createWeeklyPaycheck(int hoursWorked) { double taxRate = .2; Paycheck check; int grossPay = calcGrossPay(hoursWorked); int tax = (int) (grossPay * taxRate); check = new Paycheck(this, hoursWorked, grossPay, tax); return check; } public String getName() { return super.getName(); } public int calcGrossPay(int hoursWorked) { int money = 0; if (hoursWorked <= 40) { money = hoursWorked * wage; } else if (hoursWorked > 40) { money = (int) ((40 * wage) + ((hoursWorked - 40) * (wage * 1.5))); } return money; } public String toString() { String s = getName(); s += " (hourly, " + CurrencyFormat.format(wage) + "/hr)"; return s; } }