Seven Peaks Software Interview Question

How to use Polymorphism and Inheritance to make the code runnable?