interface EmployeeSpec{ // Declares interface implemented by class Employee String getName(); double getWkPay(); } public class Employee implements EmployeeSpec /** Class to represent an Employee. Should really be abstract. */ { // fields protected String name; /** name of employee */ protected Date birthDate; /** employee's date of birth */ // constructors -- note that constructors do not have return type! public Employee (String emp_name, Date emp_bday){ /* post: creates Employee object from name and birthdate */ name = emp_name; // initialize fields birthDate = emp_bday; } // methods public String getName() // post: Returns name of Employee { return name; // return name field } public int getAge() /** post: returns the age of the Employee */ { Date today = new Date(); // declares today and set to today's date // declare yearDiff and initialize to diff of years int yearDiff = (today.getYear() - birthDate.getYear()); if ((today.getMonth() > birthDate.getMonth()) || (today.getMonth() == birthDate.getMonth() && today.getDay() > birthDate.getDay())){ return yearDiff; // already had birthday this year } else{ return yearDiff - 1; // adjust age if not had birthday yet this year } } public double getWkPay() /** post: Return weekly pay. Will be overridden in subclasses.*/ { return 0.0;} /** This is the main program. */ public static void main(String args[]){ Date kbday = new Date(1948,10,16); System.out.println("My birthday is "+kbday+"."); Employee emp = new Employee("Kim Bruce",kbday); System.out.println("Today, the employee, "+emp.getName()+", is "+emp.getAge() +" years old."); System.out.println("He makes $"+emp.getWkPay()+" per week!"); } }