Task 2 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

11.1 Enums — declare an enum

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Write the enum TrafficLight with exactly three constants: RED, YELLOW, GREEN, in that order.

main checks them: the program prints 3, RED, 2 — the count, the constant found by name, and the position of GREEN (positions start at 0).

Your solution