Exam 2 Programming logic and design,
Comprehensive Questions and
Answers
Any decision can be made using combinations of just two types of comparisons:
equal and not equal. - ANSWER-False
____ evaluation is when each part of an expression that uses an operator is
evaluated only as far as necessary to determine whether the entire expression is
true or false. - ANSWER-Short-circuit
With a(n) ____, you perform an action or task, and then you perform the next action,
in order. - ANSWER-Sequence structure
The conditional AND operator in Java, C++, and C# is ____. - ANSWER-&&
C#, C++, C, and Java use the symbol ____ as the logical OR operator. - ANSWER-||
In C++, Java, and C#, the ____ is the symbol used for the NOT operator -
ANSWER-!=
You can use ___ for clarity and to override the default order of operations. -
ANSWER-parentheses
Most programming languages limit the number of AND and OR operators in an
expression. - ANSWER-False
For maximum efficiency, a good rule of thumb in an AND decision is to ____. -
ANSWER-first ask the question that is more likely to be false
For maximum efficiency, a good rule of thumb in an OR decision is to ____. -
ANSWER-first ask the question that is more likely to be true.
A structured program must contain a sequence, selection, and loop structure. -
ANSWER-True or (False)
Fill in the blank in the following pseudocode:
if someConditon is true then
do oneProcess
______
do theOtherProcess - ANSWER-else
In a truth table, the expression ___ is true. - ANSWER-true AND true
The following pseudocode is an example of a ____ structure.
Comprehensive Questions and
Answers
Any decision can be made using combinations of just two types of comparisons:
equal and not equal. - ANSWER-False
____ evaluation is when each part of an expression that uses an operator is
evaluated only as far as necessary to determine whether the entire expression is
true or false. - ANSWER-Short-circuit
With a(n) ____, you perform an action or task, and then you perform the next action,
in order. - ANSWER-Sequence structure
The conditional AND operator in Java, C++, and C# is ____. - ANSWER-&&
C#, C++, C, and Java use the symbol ____ as the logical OR operator. - ANSWER-||
In C++, Java, and C#, the ____ is the symbol used for the NOT operator -
ANSWER-!=
You can use ___ for clarity and to override the default order of operations. -
ANSWER-parentheses
Most programming languages limit the number of AND and OR operators in an
expression. - ANSWER-False
For maximum efficiency, a good rule of thumb in an AND decision is to ____. -
ANSWER-first ask the question that is more likely to be false
For maximum efficiency, a good rule of thumb in an OR decision is to ____. -
ANSWER-first ask the question that is more likely to be true.
A structured program must contain a sequence, selection, and loop structure. -
ANSWER-True or (False)
Fill in the blank in the following pseudocode:
if someConditon is true then
do oneProcess
______
do theOtherProcess - ANSWER-else
In a truth table, the expression ___ is true. - ANSWER-true AND true
The following pseudocode is an example of a ____ structure.