Question: Simulate a circuit for controlling a hallway light that has switches at both ends of the hallway. Each switch can be up or down, and
Simulate a circuit for controlling a hallway light that has switches at both ends of the hallway. Each switch can be up or down, and the light can be on or off. Toggling either switch turns the lamp on or off. Provide methods
public int getFirstSwitchState() // 0 for down, 1 for up
public int getSecondSwitchState()
public int getLampState() // 0 for off, 1 for on
public void toggleFirstSwitch()
public void toggleSecondSwitch()
Step by Step Solution
3.47 Rating (163 Votes )
There are 3 Steps involved in it
The private reserved word prevents a programmer using the class fro... View full answer
Get step-by-step solutions from verified subject matter experts
