| [SOLVED] Write a program in C++ which creates three classes? Write a program in C++ which creates three classes named as
oTVChannel
oNewsChannel
oMusicChannel
Where NewsChannel and MusicChannel are inherited from TVChannel
Each class has the method DisplayName. DisplayName method should be pure virtual in TVChannel class.
This method should be overridden in both the inherited classes. It is meant to display the channel name of its respective class. DisplayName of NewsChannel will display the message;
This is NewsChannel
Similarly, the DisplayName of MusicChannel will display the message;
This is MusicChannel
In main, call the DisplayName method of both the Channels polymorphically through the parent class (TVChannel). |