Lessons
C++ · Making Decisions · 13. switch and ? :

step 1 of 7

One value, many doors

switch looks at one value and walks to the case with the same number. Like doors with numbers on them.

break means: done, leave the switch.

Mission

Day 4 has no door. Add case 4: for Thursday.

PIP·1
main.cppyour code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
← press me!
readyscreen

Press RUN to see what this program does.

Do the mission and Next turns green.

switch and ? :