public class SupportStaff implements Payable { private String name, supportArea; private boolean unionized; private float payRate = 0; private double totalHours = 0; private double totalSalary = 0; public SupportStaff(String name, String supportArea, boolean unionized) { this.name = name; this.supportArea = supportArea; this.unionized = unionized; } public SupportStaff(String name, String supportArea) { this(name, supportArea, false); } public boolean isUnionized() { return unionized; } public String getSupportArea() { return supportArea; } public String toString() { return "Support Staff " + name + " in area " + supportArea + (unionized ? " UNIONIZED" : " NOT UNIONIZED"); } public String getName() { return name; } public double addHoursWorked(double h) throws Exception { if (h == 0) { throw new Exception("Cannot add zero (0) hours worked"); } else if (h < 0) { throw new Exception("Cannot add negative (" + h + ") hours worked"); } else if (payRate <= 0) { throw new Exception("Cannot use a zero or negative hourly (" + payRate + ") wage"); } double newSalary = h * payRate; totalSalary += newSalary; totalHours += h; return newSalary; } public void setPayRate(float dollars) throws Exception { if (dollars <= 0) { throw new Exception("Cannot set a zero or negative hourly (" + dollars + ") wage"); } this.payRate = dollars; } public double getSalaryTotal() { return totalSalary; } public String getAccount() { return " Current hourly wage: $" + payRate + ", Total Salary: $" + totalSalary + ", Total Hours Worked: " + totalHours; } }