Your task is to declare a scoped enum class named PinState representing the logic level of a GPIO pin.
PinState
Requirements:
Low
High
uint8_t
Implement a function:
const char* toString(PinState s)
which returns:
"LOW"
PinState::Low
"HIGH"
PinState::High
The program will:
x
0
1
0 → PinState::Low
1 → PinState::High
No other input values will be provided.
Input / Output SpecificationInput:A single integer x where:
x == 0
x == 1
Output:Print exactly one of the following strings (no newline required):
LOW
HIGH
Example 1Input:
Output:
Example 2
Input:
Test Cases
Test Results
Input
Expected Output