A universal remote has a lot of similarities to an interface. By itself a universal remote does nothing. It defines a set of buttons for standard operations, but the operation of each button must be programmed specifically to suit each kind of device that you want to control. You can represent the TV and VCR by classes, each of which will make use of the same remote-control interface. Universal remote controls perform common functionality on devices like TV and VCR: power on/off, volume up/down, Channel up/down, set Specific channel and mute. Define an interface to model the common functionality of universal remote. Define TV and VCRclasses that use the universal remote. Demonstrate polymorphic behavior with these classes and create at least two objects of each class in main method. Write some code in main to show the sample output as well.
A universal remote has a lot of similarities to an interface. By itself a universal remote does nothing. It defines a set of buttons for standard operations, but the operation of each button must be programmed specifically to suit each kind of device that you want to control. You can represent the TV and VCR by classes, each of which will make use of the same remote-control interface. Universal remote controls perform common functionality on devices like TV and VCR: power on/off, volume up/down, Channel up/down, set Specific channel and mute.
Define an interface to model the common functionality of universal remote. Define TV and VCRclasses that use the universal remote. Demonstrate polymorphic behavior with these classes and create at least two objects of each class in main method. Write some code in main to show the sample output as well.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images