A switch board has a set of buttons which are used to control the state of appliances and switch them
on
or off
.
Design a switch board simulation that is used to control electric appliances in a room. The supported
appliances are
- Fan
- AC
- Bulb This should be console application with the following behavior On startup asks user for
- Number of fans
- Number of ACs
- Number of bulbs. Setups a menu with state of each appliance
- Fan 1 is “Off”
- Fan 2 is “Off”
- AC 1 is “Off” Allows user to select the device by entering the device number. On selecting the device shows the menu
- Switch Fan 1 On (or Off based on current state)
- Back On selecting one of the option changes the state of the device and returns back to the main menu. The main menu now reflects the new state of the device such as
- Fan 1 is “On”
- Fan 2 is “Off”
- AC 1 is “Off