We have already defined a class LED with two public functions:
LED
void turnOn()
LED ON
void turnOff()
LED OFF
Your task is to:
turnOn()
turnOff()
Example
Output:
LED ON LED OFF
Why this output?
Because the program first calls turnOn(), which prints "LED ON", and then turnOff(), which prints "LED OFF".
Question Significance
This shows how to access class methods using an object, the most common way to control behavior in C++.
Test Cases
Test Results
Input
Expected Output