/** Name: Cameron Lewis Student ID: 16254966 **/ //class Contracted creates objects that can be used to print a paycheck and //personal information for contracted employees class Contracted extends Employee { //the name of the employee private String name; //the integer value of the wage of this employee private int wage; //the pay for this employee before the tax private int grossPay; //the amount of money subtracted from the grossPay after taxes private int tax; //comstructs a Contracted object with initialized variables name and wage public Contracted(String n, int w) { super(n); name = n; wage = w; } //creates a Paycheck object using @param hoursWorked so that a paycheck can be printed public Paycheck createWeeklyPaycheck(int hoursWorked) { grossPay = wage * hoursWorked; tax = 0; Employee emp = new Contracted(name, wage); 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", "Contract"); s += String.format("%-15s: %s\n", "Hourly Wage", CurrencyFormat.format(wage)); return s; } }