Chapter 5 Flashcards

(15 cards)

1
Q

A module definition consists of the module header and the module ________.
Group of answer choices

a.) arguments

b.) statements

c.) call

d.) body

A

d.) body

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

The use of ________ variables may make programs hard to understand and debug.
Group of answer choices

a.) value

b.) global

c.) local

d.) reference

A

b.) global

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

Which of the following would a programmer use to visualize the relationship between modules?
Group of answer choices

a.) a modular chart

b.) a flowchart

c.) a hierarchy chart

d.) pseudocode

A

c.) a hierarchy chart

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

A ________ variable is visible to every module and the entire program.
Group of answer choices

a.) global

b.) return

c.) reference

d.) local

A

a.) global

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

Given the following pseudocode, what, if anything, is an error?

Module main()
Declare Integer myGrade = 93
Call curveScore(myGrade)
End Module
Module curveScore(Integer score)
Declare Integer newScore
Set newScore = score + 5
Display newScore
Set myGrade = 0
End Module

a.) The curveScore module should receive a variable named score, not myGrade.

b.) The variable myGrade is not available inside the curveScore module.

c.) The variable score has not been initialized

d.) There are no errors.

A

b.) The variable myGrade is not available inside the curveScore module.

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

Given the following pseudocode, what is the value of myGrade after the call to the curveScore module?

Module main()
Declare Integer myGrade
Set myGrade = 82
Call curveScore(myGrade)
End Module
Module curveScore(Integer score)
Declare Integer newScore
Set newScore = score + 5
Display newScore
End Module

a.) 87

b.) 82

c.) 5

d.) cannot tell

A

b.) 82

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

Another name for a module is a(n) ________.

a.) object

b.) function

c.) class

d.) variable

A

b.) function

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

In a flowchart, a module call is represented by a(n) ________ symbol with vertical bars at each side.

a.) diamond

b.) oval

c.) parallelogram

d.) rectangle

A

d.) rectangle

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

Another name for a module is a(n) ________.

a.) object

b.) function

c.) class

d.) variable

A

b.) function

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

To execute a module, you must ________.

a.) parse it

b.) debug it

c.) compile it

d.) call it

A

d.) call it

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

A module definition consists of the module header and the module ________.

a.) arguments

b.) statements

c.) call

d.) body

A

d.) body

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

When an argument is passed by ________, only a copy of the argument’s value is passed into the parameter variable.

a.) return

b.) value

c.) reference

d.) hand

A

c.) reference

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

A ________ variable is visible to every module and the entire program.

a.) global

b.) return

c.) reference

d.) local

A

a.) global

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

The ________ is the first line of a module definition.

a.) introduction

b.) header

c.) call

d.) body

A

b.) header

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

The use of ________ variables may make programs hard to understand and debug.

a.) value

b.) global

c.) local

d.) reference

A

b.) global

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