Auniversal remotehas a lot of similarities to aninterface.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 theTV and VCR by classes, each of which will make use of the sameremote-control interface. Universal remote controls performcommon functionalityon devices likeTV and VCR: power on/off, volume up/down, Channel up/down, set Specific channel and mute.
Define an interfaceto model the common functionality ofuniversal remote. DefineTV and VCRclassesthat usethe universal remote.Demonstrate polymorphic behaviorwith these classes and create at leasttwo objects of each class in main method.Write some code in main to show the sample output as well.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here