Switch Statements Flashcards

1
Q

what are the labels

A

case1:
case2:
case3: etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how do we know to leave the current statement

A

break;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

general formula``

A

switch ()
{
case :

break;
case :

break;
default:

break;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

why should breaks be avoided outside of switch statements

A

makes code harder to read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what does a continue statement do

A

immediately breaks that iteration of a loop/statement and moves onto next

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

why should continues not be used

A

makes code harder to understadn

How well did you know this?
1
Not at all
2
3
4
5
Perfectly