Programming Logic & Design Module 3
Exam Questions with Complete
Answers
It is possible to write a complete program using only a decision structure. -
ANSWER-False
A nested decision structure can be used to test more than one condition. -
ANSWER-True
Pseudocode could be logically incorrect if not properly indented. - ANSWER-False
In an expression with an OR operator, it does not matter which sub expression is
true for the compound expression to be true. - ANSWER-True
A nested decision structure can achieve the same logic as a case structure. -
ANSWER-True
The first line of the case structure starts with the word CASE followed by the test
expression. - ANSWER-False
The If-Then-Else statement can be used to simplify a complex nested decision
structure. - ANSWER-True
An If statement will produce unpredictable results if the programmer does not use
proper indentations in pseudocode. - ANSWER-False
The If-Then-Else statement should be used to write a single alternative decision
structure. - ANSWER-False
The short-circuit evaluation is performed with expressions containing any logical
operators. - ANSWER-False
Although the sequence structure is heavily used in programming, it cannot handle
every type of task. - ANSWER-True
Decision structures are also known as selection structures. - ANSWER-True
When a program performs actions only under certain conditions, it is using a
_________ structure. - ANSWER-Decision
The _________ symbol is used to represent a selection structure in flowcharting. -
ANSWER-Diamond
, The _________________ decision structure provides only one alternative path of
execution. - ANSWER-Single alternative
A ____________ expression evaluates as either true or false. - ANSWER-Boolean
The ____________ operator is used to determine whether the operands are exactly
the same as each other. - ANSWER-==
In a _________________ decision structure, one path is taken if a condition is true
and the other path is taken if the condition is false. - ANSWER-Dual alternative
In an If-Then-Else statement, the Else clause marks the beginning of the statements
to be executed when the Boolean expression is _______________. - ANSWER-
False
The value of the ____________ is compared with the values that follow each of the
Case statements when a Select Case statement executes. - ANSWER-Test
expression
The __________ operator requires both sub expressions to be true for the
compound expression to be true. - ANSWER-AND
The expression with an AND operator ___________ when the expression on its left
is false and so it does not evaluate the expression on its right. - ANSWER-Short
circuits
The _____ operator is best to determine whether a number is outside a range. -
ANSWER-OR
Boolean variables are commonly used as __________, which indicate whether a
specific condition exits. - ANSWER-Flags
The ____________ statement is commonly used in programming languages for case
structure. - ANSWER-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. -
ANSWER-Default
The computer uses the ________ codes to accomplish string comparison. -
ANSWER-ASCII
____________ expressions are named in honor of mathematician George Boole. -
ANSWER-Boolean
In languages such as Java, Python, C, and C++ the ____________ operator
determines whether a variable is equal to another variable. - ANSWER-==
Some languages, such as Visual Basic, use ____________ as the not equal to
operator. - ANSWER-<>
Exam Questions with Complete
Answers
It is possible to write a complete program using only a decision structure. -
ANSWER-False
A nested decision structure can be used to test more than one condition. -
ANSWER-True
Pseudocode could be logically incorrect if not properly indented. - ANSWER-False
In an expression with an OR operator, it does not matter which sub expression is
true for the compound expression to be true. - ANSWER-True
A nested decision structure can achieve the same logic as a case structure. -
ANSWER-True
The first line of the case structure starts with the word CASE followed by the test
expression. - ANSWER-False
The If-Then-Else statement can be used to simplify a complex nested decision
structure. - ANSWER-True
An If statement will produce unpredictable results if the programmer does not use
proper indentations in pseudocode. - ANSWER-False
The If-Then-Else statement should be used to write a single alternative decision
structure. - ANSWER-False
The short-circuit evaluation is performed with expressions containing any logical
operators. - ANSWER-False
Although the sequence structure is heavily used in programming, it cannot handle
every type of task. - ANSWER-True
Decision structures are also known as selection structures. - ANSWER-True
When a program performs actions only under certain conditions, it is using a
_________ structure. - ANSWER-Decision
The _________ symbol is used to represent a selection structure in flowcharting. -
ANSWER-Diamond
, The _________________ decision structure provides only one alternative path of
execution. - ANSWER-Single alternative
A ____________ expression evaluates as either true or false. - ANSWER-Boolean
The ____________ operator is used to determine whether the operands are exactly
the same as each other. - ANSWER-==
In a _________________ decision structure, one path is taken if a condition is true
and the other path is taken if the condition is false. - ANSWER-Dual alternative
In an If-Then-Else statement, the Else clause marks the beginning of the statements
to be executed when the Boolean expression is _______________. - ANSWER-
False
The value of the ____________ is compared with the values that follow each of the
Case statements when a Select Case statement executes. - ANSWER-Test
expression
The __________ operator requires both sub expressions to be true for the
compound expression to be true. - ANSWER-AND
The expression with an AND operator ___________ when the expression on its left
is false and so it does not evaluate the expression on its right. - ANSWER-Short
circuits
The _____ operator is best to determine whether a number is outside a range. -
ANSWER-OR
Boolean variables are commonly used as __________, which indicate whether a
specific condition exits. - ANSWER-Flags
The ____________ statement is commonly used in programming languages for case
structure. - ANSWER-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. -
ANSWER-Default
The computer uses the ________ codes to accomplish string comparison. -
ANSWER-ASCII
____________ expressions are named in honor of mathematician George Boole. -
ANSWER-Boolean
In languages such as Java, Python, C, and C++ the ____________ operator
determines whether a variable is equal to another variable. - ANSWER-==
Some languages, such as Visual Basic, use ____________ as the not equal to
operator. - ANSWER-<>