The program can be greatly simplfied by making all graphical objects inherit from a common base class.
We will have much more to say about inheritance, and the power that comes from the use of inheritance, in subsequent chapters.