1) Module
2) Divide and Conquer
3) Header
4) Call
5) Return
6) Top-down Design
7) Flowchart
8) Local Variable
9) Scope
10) Argument
11) Parameter
12) By Value
13) By Reference
14) Global variable
15) Global
True or False
1) False
2) True
3) True
4) False
5) True
6) False
7) False
8) True
9) True
10) False
11) True
12) False
Short Answers
1) You can call the module several times instead of writing it out each time.
2) The header is the starting point and the body is a list of statements that belong to the module.
3) It will return back to its previous point in the program.
4) A local variable is declared inside the module only. Only the statements inside the module can access it.
5) A local variable’s scope begins at the variable’s declaration and ends at the end of the module in which the variable is declared.
6) When you pass by value you pass a copy. When you pass by reference, you can modify the contents.
7) Global variables make debugging difficult because any statement in a program can change its value.
Algorithm Workbench
1) Module timesTen(Integer value)
Declare Integer result
Set result = * 10
Display result
End Module
2) Examine the following pseudocode module header, and then write a statement that calls the module, passing 12 as an argument.
Module showValue( Integer quantity)
Module main()
Call showValue (12)
End Module
3) Look at the following pseudocode module header: Module myModule( Integer a, Integer b, Integer c) Now look at the following call to myModule: Call myModule( 3, 2, 1) When this call executes, what value will be stored in a? What value will be stored in b? What value will be stored in c?
A=3
B=2
C=1
4) Assume that a pseudocode program contains the following module: Module display( Integer arg1, Real arg2, String arg3) Display " Here are the values:" Display arg1, " ", arg2, " ", arg3 End Module
Assume that the same program has a main