/** Subclass of Employee for employees paid an annual salary. Written January 25, 1997, by Kim Bruce. */ public class ExemptEmployee extends Employee { // fields protected double yearlySalary; /** annual salary */ // constructor public ExemptEmployee (String emp_name, Date emp_bday, double annualWage) /** post: construct Employee object from name, birthday and annual salary */ { super(emp_name,emp_bday); // Call constructor from superclass yearlySalary = annualWage; } // methods public void SetAnnualPay(double new_salary) /** post: Set yearlySalary to new_salary. */ { yearlySalary = new_salary; } public double getWkPay() /** Return weekly pay. */ { return (yearlySalary / 52.0); } /** This time we test with an exempt employee */ public static void main(String args[]){ // Create my birthday. Date kbday = new Date(1948,10,16); // Create new employee ExemptEmployee emp = new ExemptEmployee("Kim Bruce",kbday,50000f); // Print out info on the employee System.out.println("Today, the employee, "+emp.getName()+", is "+emp.getAge() +" years old."); System.out.println("He makes $"+emp.getWkPay()+" per week!"); } }