Question: Change the public interface of the circuit class of Exercise E3.4 so that it has the following methods: Provide an implementation using only language

Change the public interface of the circuit class of Exercise •• E3.4 so that it has the following methods:

public int getSwitchState (int switchNum) public int getLampState() public void toggleSwitch (int

Provide an implementation using only language features that have been introduced.
The challenge is to find a data representation from which to recover the switch states.

public int getSwitchState (int switchNum) public int getLampState() public void toggleSwitch (int switchNum)

Step by Step Solution

3.35 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It looks like youre being asked to modify the public interface of a circuit class to include three methods 1 getSwitchStateint switchNum which should ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!