Ch. 5 Flashcards

(20 cards)

1
Q

C# rounds fractional values when they’re to be stored in an integer variable.
True.
False.

A

False

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

Syntax errors cause a program to fail and terminate prematurely.
True.
False.

A

False

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

The lines in an activity diagram are a graphical representation of an algorithm.
True.
False.

A

False

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

A __________ can be used in repetition structures to indicate the end of data entry.
counter
boolean
sentinel value
None of the above.

A

Sentinal value

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

Which of the following is not an algorithm?
a recipe
operating instructions
textbook index
shampoo instructions (lather, rinse, repeat)

A

Textbook index

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

The C# compiler always associates an else with the previous if, unless braces indicate otherwise.
True.
False.

A

True

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

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.

A

True

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

The while statement is an example of a sequence structure.
True.
False.

A

False

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

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

a specific condition remains true

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

if is a _________ statement.
restricted
selection
repetition
unrestricted

A

selection

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

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.

A

counter

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

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.

A

definite repetition

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

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.

A

The second operand is the result value if the condition evaluates to false.

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

The if statement is a repetition statement.
True.
False.

A

False

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

Pseudocode normally describes only executable statements.
True.
False.

A

True

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

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.

A

developing the algorithm for the solution

16
Q

Top-down, stepwise refinement helps lead to well-structured algorithms.
True.
False.

17
Q

A decision symbol in an activity diagram takes the shape of a ________.
diamond
rectangle
circle
question mark

18
Q

Which of the following conditions would cause a while statement to stop executing?
3 <= 11
!(7 != 14)
6 != 9
All of the above.

19
Q

The body of an if statement executes only if the condition is evaluated as true.
True.
False.