Programming Languages Principles and Practices 3rd Edition Louden Test Bank
Programming Languages Principles and Practices 3rd Edition Louden Test Bank
Programming Languages Principles and Practices 3rd Edition Louden Test Bank
TRUE/FALSE
1. Procedures were first introduced when memory was scarce, as a way of splitting a program into
small, separately compiled pieces.
2. An activation record is a stored log recording each time a procedure or function is activated.
3. A procedure specification includes its name, the names and types of its formal parameters and its
return type, if any.
4. You call a procedure by stating its name, together with arguments to the call.
6. A call to a procedure transfers control to the beginning of the body of the called procedure.
7. A procedure declaration creates a constant procedure value and associates a symbolic name with
that value.
10. When you define a procedure, the parameters you list in the interface are the formal parameters.
11. When parameters are passed by value, the arguments are expressions that are evaluated at the time
of the call, with the arguments’ values becoming the values of the parameters during the execution
of the procedure.
13. Pass by value implies that changes cannot occur outside the procedure through the use of
parameters.
15. If a pointer is passed by value, the procedure cannot modify the contents of the pointer.
18. Pass by name can be described as an advanced inlining process for procedures.
20. In pass by name parameter passing, arguments are not evaluated until their actual use as
parameters in the procedure.
22. In strongly typed languages, procedure calls must be checked so that the arguments agree in type
and number with the parameters of the procedure.
MULTIPLE CHOICE
5. A procedure communicates with the rest of the program through its parameters and through ____.
a. constants c. nonlocal references
b. functions d. overloaded variables
ANS: C PTS: 1 REF: 447
7. The ____ is the memory allocated for the local objects of a procedure block.
a. call record c. activation heap
b. activation record d. heap record
ANS: B PTS: 1 REF: 448
13. If a parameter behaves as a constant value during execution, the parameter is passed ___.
a. by address c. by type
b. by reference d. by value
ANS: D PTS: 1 REF: 451
14. If the parameter becomes an alias for the argument, the parameter is passed ____.
a. by reference c. by value
b. by address d. by type
ANS: A PTS: 1 REF: 452
15. Pass ____ copies in the parameter value, and at the end of execution, copies out the final value of
the parameter.
a. by value c. by value-result
b. by reference d. by address
ANS: C PTS: 1 REF: 454
16. Historically, the interpretation of pass by name arguments as functions to be evaluated was
expressed by referring to them as ____.
a. chunks c. thunks
b. objects d. expressions
ANS: C PTS: 1 REF: 456
17. In a(n) ____ environment, all memory allocation can be performed at load time, and the location of
all variables are fixed for the duration of program execution.
a. dynamic c. global
b. universal d. fully static
ANS: D PTS: 1 REF: 459
18. The ____ maintains the location of the current activation record.
a. environment pointer c. stack pointer
b. activation pointer d. stack register
ANS: A PTS: 1 REF: 462
19. The pointer to the previous activation record is the ____ link.
a. reverse c. control
b. history d. return
ANS: C PTS: 1 REF: 462
20. The local variable ____ stores the distance from the environment pointer.
a. distance c. offset
b. locator d. pointer
ANS: C PTS: 1 REF: 464
22. ____ occurs when multiple access links must be followed to arrive at a nonlocal variable.
a. Access chaining c. Environmental linking
b. Lexical chaining d. Global linking
ANS: A PTS: 1 REF: 468
23. In a(n) ____ environment, activation records are not removed as long as there are references to any
of its local objects.
a. closed c. type safe
b. fully dynamic d. fully static
ANS: B PTS: 1 REF: 472
24. The process of joining a block of free memory with immediately adjacent blocks to form a larger
contiguous block of free memory is called ____.
a. consolidation c. reference counting
b. defragmenting d. coalescing
ANS: D PTS: 1 REF: 474