C++ hierarchical inheritance
In c++ such problems can be easily convert into class heirarchies. The
base class will include all features that are common to subclasses .
A subclasses. A subclass can be constructed by inheriting the properties if the base class.
A subclass can be constructed by using inheriting the properties of the base class.A subclass can serve as a base class for the lower level class and so on