Write a program which has an abstract class called Number having an integer data member. The class contains a pure virtual function called operation. A class called odd is derived from class called Number. Another class called Even is derived from class Number. Yet another class called prime is derived from Number. Use appropriate constructors and redefine the function called operation to display if the number is odd, even or prime. You may make use of other data members and member functions if needed
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
. Write a
Step by step
Solved in 3 steps with 2 images