Other Computing Topics


Answer & solution
Answer: A (no official key was published)
1. The common name and identifier accessors can be implemented once in Employee, statements i and iv. Salary computation varies by employee category, so declare it abstract in Employee and implement it in each category subclass, vi and viii.
2. Thus A is the best listed design. The narrative says computeSalary while the numbered statements say getSalary; the intended varying salary operation is treated consistently.
3. Teaching check: Inheritance should share the common accessors while polymorphism handles category-specific salary rules. An abstract salary method specifies the common interface without imposing one implementation. Making getName abstract duplicates a behavior that the problem gives no reason to vary.