Question: Question E3.3 and attached tester in E3.4. Thank you! E3.3 Simulate a circuit for controlling a hallway light that has switches at both ends of
Question E3.3 and attached tester in E3.4. Thank you!
E3.3 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 getFirstSwitchStateO // 0 for down, 1 for up public int getSecondSwitchState() public int getLampStateO // O for off, 1 for on public void toggleFirstSwitchO public void toggleSecondSwitchO Testing E3.4 Write a CircuitTester class that tests all switch combinations in Exercise E3.3, print- ing out actual and expected states for the switches and lamps
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
