O'Reilly logo

Visual C#® 2012: How to Program, Fifth Edition by Harvey Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercises

11.2 (Composition vs. Inheritance) Many apps written with inheritance could be written with composition instead, and vice versa. Rewrite class BasePlusCommissionEmployee (Fig. 11.13) of the CommissionEmployeeBasePlusCommissionEmployee hierarchy to use composition rather than inheritance.

11.3 (Inheritance and Software Reuse) Discuss the ways in which inheritance promotes software reuse, saves time during app development and helps prevent errors.

11.4 (Student Inheritance Hierarchy) Draw a UML class diagram for an inheritance hierarchy for students at a university similar to the hierarchy shown in Fig. 11.2. Use Student as the base class of the hierarchy, then extend Student with classes UndergraduateStudent and GraduateStudent. Continue ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required