Review Questions

1:You have just started working on two software projects and identified the following classes in the two programs:

Program 1: Airplane, jet engines, wings, airplane body, passenger seats, and cockpit

Program 2: Person, student, employee, undergraduate, graduate, secretary, cleaner, and director

Which program seems able to benefit the most from inheritance? Why? Which concept is the other program likely to benefit from?

2:Consider the following class hierarchy.

In which class would you include each of the following class members:

  1. The brandName instance variable

  2. The Autodial method

  3. The Start method

  4. The Tuning method

  5. The purchasePrice ...

Get C# Primer Plus now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.