Skip to Content
Navigating C++ and Object-Oriented Design
book

Navigating C++ and Object-Oriented Design

by Paul Anderson, Gail Anderson
October 1997
Intermediate to advanced
800 pages
20h 48m
English
Pearson
Content preview from Navigating C++ and Object-Oriented Design

11.16. Exercises

1:Implement the inheritance hierarchy shown in Figure 11.2 on page 479 for Metal_Crate and Wood_Crate objects.
2:Derivation comes is three flavors: public, private, and protected. Summarize the characteristics of each one. Which type of derivation must you use to implement generalization and polymorphism?
3:Implement resize() member functions for the Array (Listing 11.8 on page 503) and Array2d (Listing 11.9 on page 504) inheritance hierarchy. Write programs to test your solution. Why doesn't resize() have to be virtual?
4:Design a three-dimensional Array3d class, using template composition with public inheritance and protected access to Array. Test your solution with a program similar to Listing 10.13 on page 436.
5:Compare and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Exploring C++20: The Programmer's Introduction to C++

Exploring C++20: The Programmer's Introduction to C++

Ray Lischner

Publisher Resources

ISBN: 0135327482Purchase book