Program Flow Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is the flow of a program?

A

The order that the steps are carried out in
Controlled using selection statements (if and switch)

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

IF Statements

A

To check if a condition is true or false, and lead to different actions depending on choice

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

NESTED IF Statements

A

An IF statement within another IF statement
Allow you to check more conditions due to a previous condition being established

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

SWITCH Statements

A

To check if a variable has a specific value
When you want different actions to be performed for different values of the same variable

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

Con of SWITCH Statements

A

Can only check for one variable

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

FOR Loops

A

Repeat code inside them for fixed number if times
e.g. for x = 1 to 100
this means loops 100 times

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

DO UNTIL Loops

A

Controlled by a condition at the end of the loop
Repeats until the condition is true

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

WHILE Loops

A

Controlled by a condition at the start of the loop
Repeats while the condition is true

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

What is used at the start and end of a DO UNTIL Loop?

A

‘do’
‘until’

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

What is used at the start and end of a WHILE Loop?

A

‘while’
‘endwhile’

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

What is used at the start and end of a SWITCH Statement?

A

‘switch’
‘endswitch’

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