Frame a class LED with the following:
void turnOn()
void turnOff()
void toggle()
string getState() const
The input will contain:
The output should be the final state of the LED (ON or OFF).
Example Input:
13 3 on toggle toggle
Output:
ON
Here, pin = 13, operations = on → toggle → toggle.
Input:
7 2 on off
OFF
Here, pin = 7, operations = on → off.
Test Cases
Test Results
Input
Expected Output