18 Questions
In the context of parameter passing methods, which of the following is a common way to pass parameters?
Pass-by-value
What does call by value provide when a subroutine is called?
A copy of the variable's value
Which programming language supports both pass-by-value and pass-by-reference techniques?
C++
What happens when copies are used in call by value parameter passing?
Additional storage is required
What is the purpose of the static chain in the stack layout?
Referencing the lexically surrounding subroutine
What are the tasks involved in the prologue of the calling sequence?
Passing parameters, saving return address
What is the primary difference between pass-by-value and pass-by-reference parameter passing methods?
The independence of the original variable and its copy
What is the role of the static chain in the stack layout?
Referencing the lexically surrounding subroutine
What are the tasks involved in the epilogue of the calling sequence?
Deallocating stack frame, restoring saved registers and pc
What is a key consideration for understanding parameter passing methods in programming languages?
The engineering tradeoffs involved
What is a subprogram that returns a value called?
Function
Which part of the subprogram definition includes the name, kind of subprogram, and the formal parameters?
Subprogram header
What is the variable listed in the subprogram header and used in the subprogram called?
Formal parameter
What is an explicit request for the execution of a subprogram called?
Subprogram call
Which category of subprograms does not return a value?
Procedure
What provides only the protocol, but not the body, of a subprogram?
Subprogram declaration
What represents a value or address used in the subprogram call statement?
Actual parameter
What is the number, order, and types of parameters of a subprogram called?
Parameter profile
Test your knowledge on the structure of programming language subroutines, including procedures and functions, subprogram calls, headers, and parameter profiles.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free