Question: Define a class Controller with four virtual functions on(), off(), set_level(int), and show(). Derive at least two classes from Controller. One should be a simple
Define a class Controller with four virtual functions on(), off(), set_level(int), and show(). Derive at least two classes from Controller. One should be a simple test class where show() prints out whether the class is set to on or off and what is the current level. The second derived class should somehow control the line color of a Shape; the exact meaning of “level” is up to you. Try to find a third “thing” to control with such a Controller class.
Step by Step Solution
3.50 Rating (167 Votes )
There are 3 Steps involved in it
Heres an example of a class Controller with the specified virtual functions The 0 ... View full answer
Get step-by-step solutions from verified subject matter experts
