/** Name: Cameron Lewis Student ID: 16254966 **/ //class Salaried constructs objects that can be used to print paychecks and //personal information about salaried employees class Salaried extends Employee { //the name of the employee private String name; //the annual salary for a specified employee private int salary; //the pay for this employee before the tax private int grossPay; //the amount of money subtracted from the grossPay after taxes private int tax; //creates a Salaried object and initializes name and salary public Salaried(String n, int s) { super(n); name = n; salary = s; } //creates a Paycheck object using @param hoursWorked so that the paycheck can be printed for a specific employee public Paycheck createWeeklyPaycheck(int hoursWorked) { grossPay = salary / 52; tax = grossPay / 5; Employee emp = new Salaried(name, salary); Paycheck oneWeek = new Paycheck(emp, hoursWorked, grossPay, tax); return oneWeek; } //used to print the information about a specific employee public String toString() { String s = ""; s += String.format("%-20s", name); s += String.format("%-10s", "Salary"); s += String.format("%-15s: %s\n", "Yearly Salary", CurrencyFormat.format(salary)); return s; } }