cfp 4 Flashcards

1
Q

instead of writing many if else statements, use

A

switch statement

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

selects one of many code blocks to be executed

A

switch statement

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

stop the execution of more code and case testing inside the block

A

break keyword

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

can save a lot of execution time because it “ignores” the execution of all the rest of the code in the switch block

A

break

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

specifies some code to run if there is no case match

A

default keyword

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

can execute a block of code as long as a specified condition is reached

A

loops

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

loops through a block of code as long as a specified condition is true

A

while loop

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

is a variant of the while loop

A

do/while loop

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

execute the code block once before checking if the condition is true, then it will repeat the loop as long as the condition is true

A

do/while loop

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

when you know exactly how many times you want to loop through a block of code

A

for loop

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

was used to “jump out” of a switch statement

A

break

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

breaks one iteration, if a specified condition occurs, and continues with the next iteration on the loop

A

continue

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