wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Switch case

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

By the ? keyword, the other cases will not be executed and the program continues executing the code after the switch case if there is more code.

Which is the "?" keyword?

(a)  

2.

The code inside the ? case will be executed if the expression doesn't correspond to the other cases.

Which is the "?" case?

(a)  

3.

What we can use, if we want to execute certain code in situation, that the expression doesn't corresponds to the other cases that we have?

a)

The default case

b)

The break case

c)

If case

d)

We can't execute that code

4.

What is the keyword that we use, when we want to have different cases based on the expression's value?

a)

switch

b)

Switch

c)

if

d)

default

5.

Can I make a switch case without inserting code to be executed in the default case?

a)

No

b)

Yes

6.

Can you use if case instead of switch case?

a)

Yes

b)

No

7.

Is that correct?

switch (number < 10) ...

a)

Yes

b)

No

8.

Choose the correct answer

a)

case "cat":

b)

case: cat

c)

case: "cat"

d)

case cat:

9.

Is that correct "case 5:"?

a)

Yes

b)

No

10.

Is that correct?

case "s":

a)

Yes

b)

No