January 2014
Intermediate to advanced
736 pages
70h 43m
English
Class CommissionEmployee (Fig. G.19) extends class Employee (line 4). The class includes a constructor (lines 10–16) that takes a first name, a last name, a social security number, a sales amount and a commission rate; set methods (lines 19–26 and 35–42) to assign new values to instance variables commissionRate and grossSales, respectively; get methods (lines 29–32 and 45–48) that retrieve the values of these instance variables; method earnings (lines 51–55) to calculate a CommissionEmployee’s earnings; and method toString (lines 58–65), which returns the employee’s type, namely, "commission employee: " and employee-specific information. The constructor also passes the first name, last name and social ...
Read now
Unlock full access