Chapter 2 Flashcards

1
Q

Which module in a typical program will execute the most times?

A

the detail loop

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

A hierarchy chart tells you ____________.

A

which modules call other modules

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

Modularization ____________.

A

facilitates reusability

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

Which of the following is not a typical housekeeping task?

A

printing summaries

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

In most modern programming languages, a variable or constant that is declared in a module is ____________ in that module.

A

in scope

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

A variable’s data type describes all of the following except ____________.

A

the scope of the variable

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

The value stored in an uninitialized variable is ____________.

A

garbage

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

The value 3 is a ____________.

A

numeric constant

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

The assignment operator ____________.

A

is a binary operator

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

Programmers say that one module can ____________ another, meaning that the first module causes the second module to execute.

A

call

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

Multiplication has a lower precedence than ____________.

A

a. division
b. assignment
c. subtraction
d. none of the above*

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

The more that a module’s statements contribute to the same job, the greater the ____________ of the module.

A

functional cohesion

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

Program comments are ____________.

A

a. required to create a runnable program
b. a form of external documentation
c. both of the above
d. none of the above*

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

What are nonexecuting statements that programmers place within code to explain program statements in English?

A

comments

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

Which of the following is valid advice for naming variables?

A

To make names easier to read, separate long names by using underscores or capitalization for each new word.

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

Which of the following is not a term used as a synonym for module?

17
Q

What is the name for the process of paying attention to important properties while ignoring nonessential details?

A

abstraction

18
Q

A message that asks a user for input is a(n) ____________.

19
Q

What does a declaration provide for a variable?

A

a. a name
b. a data type
c. both of the above*
d. none of the above

20
Q

Every module has all of the following except___________ .

A

b. local variables