Ch. 5 Flashcards
(20 cards)
C# rounds fractional values when they’re to be stored in an integer variable.
True.
False.
False
Syntax errors cause a program to fail and terminate prematurely.
True.
False.
False
The lines in an activity diagram are a graphical representation of an algorithm.
True.
False.
False
A __________ can be used in repetition structures to indicate the end of data entry.
counter
boolean
sentinel value
None of the above.
Sentinal value
Which of the following is not an algorithm?
a recipe
operating instructions
textbook index
shampoo instructions (lather, rinse, repeat)
Textbook index
The C# compiler always associates an else with the previous if, unless braces indicate otherwise.
True.
False.
True
During the 1960s, it became clear that the indiscriminate use of transfers of control was the root of much difficulty experienced by software development groups.
True.
False.
True
The while statement is an example of a sequence structure.
True.
False.
False
A while statement allows you to specify that an action should repeat while:
a specific condition remains false
a specific condition remains true
a specific condition remains either true or false
None of the above.
a specific condition remains true
if is a _________ statement.
restricted
selection
repetition
unrestricted
selection
A _________ can be used in a repetition structure to control the number of times a set of statements will execute.
declaration
counter
controller
None of the above.
counter
It is known as _________ when the number of repetitions is known before a loop begins executing.
definite repetition
infinite repetition
total repetition
None of the above.
definite repetition
Which of the following statements about the conditional operator (?:) is false?
The conditional operator is a ternary operator, meaning that it takes three operands.
The first operand is a bool expression.
The second operand is the result value if the condition evaluates to false.
The second operand is the result value if the condition evaluates to true.
The second operand is the result value if the condition evaluates to false.
The if statement is a repetition statement.
True.
False.
False
Pseudocode normally describes only executable statements.
True.
False.
True
What is typically the most difficult part of solving a problem on a computer?
deciding what problem needs to be solved
developing the algorithm for the solution
producing a C# program from the algorithm
None of the above.
developing the algorithm for the solution
Top-down, stepwise refinement helps lead to well-structured algorithms.
True.
False.
True
A decision symbol in an activity diagram takes the shape of a ________.
diamond
rectangle
circle
question mark
diamond
Which of the following conditions would cause a while statement to stop executing?
3 <= 11
!(7 != 14)
6 != 9
All of the above.
!(7 != 14)
The body of an if statement executes only if the condition is evaluated as true.
True.
False.
True