Decisions with if and else

Predict the room status for each number of seats left.

Examples

Example 1

Input
0
Expected output
Full

Example 2

Input
3
Expected output
Almost full

Example 3

Input
4
Expected output
Open

Hints and solution

Hint 1

Test the exact match for zero first.

Reveal worked answer

Zero matches the first branch. Values 1 through 3 match the second branch. Values above 3 reach the fallback.

Back to the lesson