Chapter 4 Review Quiz
A compound Boolean expression created with the AND operator is true only when both subexpressions are true.
true
A nested decision structure can achieve the same logic as a case structure.
true
A nested decision structure can be used to test more than one condition.
true
Although the sequence structure is heavily used in programming, it cannot handle every type of task.
true
Decision structures are also known as selection structures.
true
In an expression with an OR operator, it does not matter which sub expression is true for the compound expression to be true.
true
The "If-Then-Else If" statement can be used to simplify a complex nested decision structure.
true
some languages, such as Visual Basic, use ___ as the not equal to operator
<>
in languages such as Java, Python, C, and C++ the ___ operator determines whether a variable is equal to another variable
==
A compound Boolean expression created with the _____ operator is true only if both of its subexpressions are true.
AND
the ___ operator requires both sub expressions to be true for the compound expression to be true
AND
Which operator is best to determine whether x contains a value in the range of 10 through 57?
AND (used for inside a range of numbers)
What two logical operators perform short-circuit evaluation?
AND and OR
Which type of logical operator are there?
AND, OR, NOT
the computer uses the ___ codes to accomplish string comparison
ASCII
A condition is a _____________ expression.
Boolean
A(n) _____ expression has a value of either true or false.
Boolean
___ expressions are named in honor of mathematician George Boole
Boolean
Which structure is a logical design that controls the order in which a set of statements executes?
Control
A(n) _____ section of a Select Case statement is branched to if none of the case values match the expression listed after the Select statement.
Default
If the expression is false the ____________ operator will return true.
NOT
The _____ operator takes a Boolean expression as its operand and reverses its logical value.
NOT
The _________ operator is a unary operator as it works with only one operand.
NOT
Which operator is used to determine that the operands are not exactly of the same value?
None of the answers; (!=)
You use a(n) _____ statement in pseudocode to write a single alternative decision structure.
If-Then
What type of operators are the following? > < >= <= == !=
Relational
A compound Boolean expression created with the _____ operator is true if either of its subexpressions is true.
OR
Which operator would make the following expression true? False _______ True
OR
the ___ operator is best to determine whether a number is outside a range
OR
Consider the following statement: A store is giving a discount of 30% for all purchases of over $100. Which of the following is not the appropriate structure to use to program the statement?
Sequence
A program can be made of only one rype of control structure. You cannot combine structures.
false
It is possible to write a complete program using only a decision structure.
false
Pseudocode could be logically incorrect if not properly indented.
false
The short-circuit evaluation is performed with expressions containing any logical operators.
false
if an If-Then-Else statement, the Else clause marks the beginning of the statements to be executed when the Boolean expression is ___
false
An If statement will produce unpredictable results if the programmer does not use proper indentations in pseudocode.
false; it's pseudocode
Boolean variables are commonly used as ___, which indicate whether a specific condition exists
flags
The symbols >, <, and == are all _____ operators.
relational
the expressions with an AND operator ___ when the expression on its left is false and so it does not evaluate the expression on its right
short circuits
the ___ statement is commonly used in programming languages for case structure
switch
the value of the ___ is compared with the values that follow each of the Case statements when a Select Case statement executes
test expression
A decision structure can be nested inside another decision structure.
True
In many languages the case structure is called a ____________ statement.
Switch
the statement(s) that immediately follow the ___ statement is executed if the test expression in the case structure does not match any case values
default
AND, OR, and NOT are _____ operators.
logical
A ______ structure allows you to test the value of a variable or an expression and then use that value to determine which statement or set of statements to execute.
multiple alternative decision