Unit 5 decision structures part 1 Flashcards

(5 cards)

1
Q

What is the if statement

A

-decides whether a section of code executes or not
-the if statement uses a Boolean to decide whether the next statement or block of statements executes(if Boolean expression is true, execute next statement

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

What are flags

A

-A flag is a boolean variable (true or false) used to remeber if something has happened in your program
-when something is true turn the flag on and when its false the flag stays off

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

What are if-else statements

A

-an if else statement lets your program choose between two possible paths, one for when the condition is true and one for when its false

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

What are nested if statements

A

A nested if statement is when you put one if statement inside another
-The inner if only runs if the outer if is true. So first check outer. Think of it as a second question thats only asked if the first question was yes

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