4. Conditional execution Flashcards

1
Q

What do we mean by conditional execution?

A

Executing certain instructions under certain circumstances, based on the values of the variables in the program.

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

How many possible values does a boolean expression have?

A

Either true or false

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

How many relational operators are there, and what are they?

A

1) == - equal
2) != - not equal
3) < - less than
4) > - greater than
5) <= - less than or equal
6) >= - greater than or equal

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

What are the three parts of an if else statement?

A

1) A condition or boolean expression.
2) A statement which will be executed when the condition is true.
3) Another statement which will be executed when the condition is false.

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

What is special about the way we lay out if else statements contained within the false part of another?

A

We say they are nested, and indent the next if-else statement more, than the first else statement.

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

What is the relationship between the if statement and the if else statement?

A

ss

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

What is the point of putting a list of statements inside a compound statement?

A

ss

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