chapter 4 book Flashcards

1
Q

The if-then clause is the part of a decision that executes when a tested condition in a decision is true.

A

TRUE

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

The else clause is the part of a decision that executes when a tested condition in a decision is true.

A

FALSE

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

A Boolean expression is one whose value is true or false.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
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
5
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
6
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
7
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
8
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
9
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 to be true.

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
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
11
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
12
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
13
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
14
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
15
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
16
Q

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

17
Q

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

18
Q

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

19
Q

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

20
Q

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

21
Q

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

22
Q

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

23
Q

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

24
Q

The syntax of the case structure varies among programming languages.