Chapter 4 Flashcards

1
Q

Usually, you can compare only values that are of the same data type.

A

True

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

A Boolean expression is defined as one that decides whether two values are equal.

A

False

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

In any logical comparison expression, the two values compared can be either variables or constants.

A

True

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

When you nest selection structures because the resulting action requires that two conditions be true, either decision logically can be made first and the results will be the same.

A

True

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

When two selections are required for an action to take place, you often can improve your program’s performance by appropriately choosing which selection to make first.

A

True

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

To improve efficiency in a nested selection in which two conditions must be true for some action to occur, you should first evaluate the condition that is more likely

A

False

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

In an OR selection, two or more conditions must be met in order for an event to take place.

A

False

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

When you use an OR selection with two conditions, you can choose to evaluate either condition first and still achieve a usable program.

A

True

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

The general rule is: In an OR decision, first evaluate the condition that is more likely to be true.

A

True

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

The value of x <> 0 is the same as the value of NOT (x = 0).

A

True

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

The value of x > y is the same as the value of NOT (x < y).

A

False

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

The value of x = y OR x > 5 is the same as the value of x = y OR NOT (x <= 5).

A

True

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

When you perform a range check, you compare a variable to every value in a series of ranges

A

False

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

You can perform a range check by making comparisons using the lowest value in each range of values you are using.

A

True

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

You can perform a range check by making comparisons using the highest value in each range of values you are using.

A

True

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

Most programming languages allow you to combine as many AND and OR operators in an expression as you need.

17
Q

When you combine AND and OR operators, the OR operators take precedence, meaning their Boolean values are evaluated first.

18
Q

You always can avoid the confusion of mixing AND and OR decisions by nesting if statements instead of using AND and OR operators.

19
Q

The case structure is used when a series of decisions is based on multiple variables.

20
Q

The case structure is used when a series of decisions is based on multiple possible values for a single variable.

21
Q

The syntax of the case structure varies among programming languages.