Chapter 5 Flashcards
(15 cards)
A module definition consists of the module header and the module ________.
Group of answer choices
a.) arguments
b.) statements
c.) call
d.) body
d.) body
The use of ________ variables may make programs hard to understand and debug.
Group of answer choices
a.) value
b.) global
c.) local
d.) reference
b.) global
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
c.) a hierarchy chart
A ________ variable is visible to every module and the entire program.
Group of answer choices
a.) global
b.) return
c.) reference
d.) local
a.) global
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.
b.) The variable myGrade is not available inside the curveScore module.
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
b.) 82
Another name for a module is a(n) ________.
a.) object
b.) function
c.) class
d.) variable
b.) function
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
d.) rectangle
Another name for a module is a(n) ________.
a.) object
b.) function
c.) class
d.) variable
b.) function
To execute a module, you must ________.
a.) parse it
b.) debug it
c.) compile it
d.) call it
d.) call it
A module definition consists of the module header and the module ________.
a.) arguments
b.) statements
c.) call
d.) body
d.) body
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
c.) reference
A ________ variable is visible to every module and the entire program.
a.) global
b.) return
c.) reference
d.) local
a.) global
The ________ is the first line of a module definition.
a.) introduction
b.) header
c.) call
d.) body
b.) header
The use of ________ variables may make programs hard to understand and debug.
a.) value
b.) global
c.) local
d.) reference
b.) global