Requirements
Write a base class “number” that holds a single integer value (value of intInput) and contains one pure virtual member function, print_it(). This will make the base class abstract in order to prevent its instantiation. Define three derived classes to print the value in hexadecimal, octal, and binary (overriding the print_it() method). Write a program to demonstrate the use of all the derived classes. The user should enter the value to be converted (intInput).
In order to demonstrate polymorphism, the code in main() should look like:
…
number* Example;
Example = new hexadecimal(intInput);
Example->print_it();
// compiler takes care of binding and prints the value in hexadecimal
delete Example;
Example = new octal(intInput);
Example->print_it();
…