public class Executive
1: //Executive.java
3: /**
4: * This class extends the Worder class and implements PayInterface.
5: * It inherits the getName() method from the Worker superclass, but
6: * implements its own verion of the getGrossWage() method required
7: * by the PayInterface.
8: */
9: public class Executive
10: extends Worker
11: implements PayInterface
12: {
13: protected double annualSalary;
16: /**
17: * Non-default constructor.
18: * Constructs an executive with the name supplied as parameter.
19: */
20: public Executive(String name)
21: {
22: super(name);
23: }
26: /**
27: * Sets the annual salary of the executive.
28: * @param salary Annual salary in dollars and cents.
29: */
30: public void setAnnualSalary(double salary)
31: {
32: annualSalary = salary;
33: }
36: //This is the method whose implemenation is required in order
37: //that the PayInterface be implemented.
38: /**
39: * Gets the gross weekly wage of an executive.
40: * @return The weekly wage of the executive in dollars and cents.
41: */
42: public double getGrossWage()
43: {
44: return annualSalary / 12.0 / 4.0;
45: }
46: }