Exercises in this lecture   previous -- Keyboard shortcut: 'p'        Go to the notes, in which this exercise belongs -- Keyboard shortcut: 'u'   Alphabetic index   Course home      

Exercise 8.6
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.