Task 6 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.2 Switch expressions — red or black suit

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

Fill in isRed using a switch expression over the Suit enum: hearts and diamonds are red, clubs and spades are not.

Write the constant names bare, without Suit. in front. All four are covered, so no default is needed. The program prints true and then false.

Your solution