A C++ example of classes and inheritance
Write a C++ program that uses 7 classes following a tree inheritance structure.
The base class must also have a virtual print() function that displays the class name.
Randomly assign print functions in three other classes that display the class name.
Create 7 pointers of the base class and have them point to all the classes.
Use the pointers to call print functions of all classes.