next up previous contents
Next: Program 3 (25 points) Up: Questions Previous: Program 1 (20 points)   Contents

Program 2 (25 points)

Rewrite question 1 such that instead of an inheritance hierarchy you use the composite design pattern for the representation of the animal kingdom.

Answer in the comments of your driver class if this does this solve the breach of polymorphism? Why (not)? Explain which approach you would choose.

Marina De Vos 2004-10-28