Topic 4: Making Decisions Flashcards

1
Q

Represents only one of two states

A

Boolean expression

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

Expression evaluates to either true or false

A

Boolean expression

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

To express Boolean tests when comparing values

A

Relational comparison operators

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

(Using relational operators) Rule of thumb: Ask the question most likely to have a __________ outcome first

A

positive

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

(Using relational operators) Rule of thumb: Avoid “_________” when it results in a double negative

A

not equal

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

Requires that both of two tests evaluate to True

A

AND decision

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

Requires a nested decision (nested if)

A

AND decision

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

(Nested AND Decisions) Rule of Thumb: First ask the question that is _____ likely to be true

A

less

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

Allows you to ask two or more questions (Boolean expressions) in a single comparison

A

Logical AND operator

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

(OR decisions) Rule of Thumb: First ask the question that is ______ likely to be true

A

more

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

Only one Boolean expression must be true to produce a result of true

A

Logical OR operator

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

Compare a variable to a series of values between limits

A

Range check

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

Should end points of the range include <= or >= ?

A

Yes; don’t use < or >

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

When AND and OR operators are combined in the same statement, _____ operators are evaluated first

A

AND

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

Can avoid mixing AND and OR decisions by nesting ____ statements

A

if

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