Object Declaration and Function Access

#include <iostream>
using namespace std;

class LED {
public:
    void turnOn()  { cout << "LED ON\n"; }
    void turnOff() { cout << "LED OFF\n"; }
};

int main() {
    // your code here: declare LED object and call its functions
    LED myLED;

    myLED.turnOn();
    myLED.turnOff();

    return 0;
}
Upvote
Downvote
Loading...

Input

Expected Output

LED ON LED OFF