Exercises in this lecture  previous -- Keyboard shortcut: 'p'        Go to the slide, where this exercise belongs -- Keyboard shortcut: 'u'  

Exercise 8.5
An abstract GameObject class


On the slide, to which this exercise belongs, we have written an interface IGameObject which is implemented by both class Die and class Card.

Restructure this program such that class Die and class Card both inherit an abstract class GameObject. You should write the class GameObject.

The client program should survive this restructuring. (You may, however, need to change the name of the type IGameObject to GameObject). Compile and run the given client program with your classes.


Solution