[Exercise 12]

Inheritance / virtual Functions II

[difficult]

description | solution | discussion
exercises after lesson "Inheritance"
list of all exercises

Do the same as in exercise 11 for program exer12.cpp (*). This program is more complex as it combines the "dynamic, run-time" cocept of virtual functions with "static, compile-time" concepts. For method "f" the concepts of "overloading" and "overwriting" are used together; for method "g", "overwriting" is combined with default values.

Solution:

Additionally needed sources:

Discussion of solution (*)