February 2014
Beginner
1248 pages
62h 25m
English
Class CommissionEmployee (Fig. 10.7) extends class Employee (line 4). The class includes a constructor (lines 10–25) that takes a first name, a last name, a social security number, a sales amount and a commission rate; set methods (lines 28–34 and 43–50) to assign valid new values to instance variables commissionRate and grossSales, respectively; get methods (lines 37–40 and 53–56) that retrieve the values of these instance variables; method earnings (lines 59–63) to calculate a CommissionEmployee’s earnings; and method toString (lines 66–73), which returns the employee’s type, namely, "commission employee: " and employee-specific information. The constructor also passes the first name, last name ...
Read now
Unlock full access