Which of the following parameter passing techniques involves copying the argument
Question # 00256483
Posted By:
Updated on: 04/18/2016 09:04 AM Due on: 05/18/2016
Question 1 (5 points)
Which of the following parameter passing techniques involves copying the argument to the corresponding
parameter?
Question 1 options:
Call by result
Call by reference
Call by name
Call by value
Save
Question 2 (5 points)
In languages that distinguish between procedures and functions how do procedure calls compare to
function calls?
Question 2 options:
Both function and procedure calls are expressions
Both function and procedure calls are statements
A function call is an expression whereas a procedure call is a statement
A function call is a statement whereas a procedure call is an expression
Save
Question 3 (5 points)
What is the scope of a local variable?
Question 3 options:
The package
The class
The subprogram
The program
Save
Question 4 (5 points)
When the static modifier is placed on a C++ local variable, what does it change?
Question 4 options:
The lifetime of the variable
The scope of the variable
Both the scope and lifetime of the variable
The initial value of the variable
Save
Question 5 (5 points)
Which is the following is not contained in an activation record?
Question 5 options:
Local variables
Global variables
Parameters
Temporary variables
Save
Question 6 (5 points)
For which of the following parameter passing techniques can the argument be a constant or an
expression?
Question 6 options:
Call by value
Call by result
Call by reference
Call by value-result
Save
Question 7 (5 points)
Which of the following function prototypes would be permitted for a C or C++ function with a
multidimensional array parameter?
Question 7 options:
void f(int matrix [10])
void f(int matrix)
void f(int matrix )
void f(int matrix [10])
Save
Question 8 (5 points)
In which of the following languages is it impossible to write a subprogram that swaps two parameters of a
primitive integer type?
Question 8 options:
Java
Ada
C
C++
Save
Question 9 (5 points)
Which of the following languages does not permit operator overloading?
Question 9 options:
Java
C#
Ada
C++
Save
Question 10 (5 points)
Which of the following languages does not permit subprograms or pointers to them to be passed as
parameters?
Question 10 options:
Ada
Pascal
C++
Java
Save
Question 11 (5 points)
What kind of method does the following Java method signature define? public static <T> sort(T array);
Question 11 options:
An abstract method
An overloaded method
A generic method
A nested method
Save
Question 12 (5 points)
Pass-by-result is an implementation model for which parameter mode?
Question 12 options:
in
out-in
out
in-out
Save
Question 13 (5 points)
Which all the following parameter passing techniques can not be used to pass data in and back out from
a subprogram?
Question 13 options:
Call-by-value
Call by value-result
Call by name
Call by reference
Save
Question 14 (5 points)
Which of the following languages does not allow default parameters?
Question 14 options:
C++
Java
Ada
C#
Save
Question 15 (5 points)
Which of the following languages permits nested subprograms?
Question 15 options:
Ada
Java
C
C++
Save
Question 16 (5 points)
Which type of variables are stored in activation records?
Question 16 options:
Static global variables
Heap-dynamic variables
Stack-dynamic local variables
Heap global variables
Save
Question 17 (5 points)
When a language allows nested subprograms, which of the following techniques can be used to
implement the storage of their local variables?
Question 17 options:
Blocks
Parameter chains
Dynamic chains
Static chains
Save
Question 18 (5 points)
Which of the following best describe the relative complexity of implementing nested subprograms
compared to nested blocks.
Question 18 options:
Implementing nested subprograms is simpler
Implementing nested blocks is simpler
They are both equally complex
It depends upon the length of the block or subprogram
Save
Question 19 (5 points)
What C++ parameter passing technique can be used in place of call-by-value when it is desirable to avoid
making a copy of the parameter?
Question 19 options:
by result
by value-result
by reference
by constant reference
Save
Question 20 (5 points)
Which of the following is the correct statement about parameter passing in Java?
Question 20 options:
primitives are passed by value and object are passed by reference
everything is passed by value
the programmer can code passing by value or reference
everything is passed by reference
Save
Which of the following parameter passing techniques involves copying the argument to the corresponding
parameter?
Question 1 options:
Call by result
Call by reference
Call by name
Call by value
Save
Question 2 (5 points)
In languages that distinguish between procedures and functions how do procedure calls compare to
function calls?
Question 2 options:
Both function and procedure calls are expressions
Both function and procedure calls are statements
A function call is an expression whereas a procedure call is a statement
A function call is a statement whereas a procedure call is an expression
Save
Question 3 (5 points)
What is the scope of a local variable?
Question 3 options:
The package
The class
The subprogram
The program
Save
Question 4 (5 points)
When the static modifier is placed on a C++ local variable, what does it change?
Question 4 options:
The lifetime of the variable
The scope of the variable
Both the scope and lifetime of the variable
The initial value of the variable
Save
Question 5 (5 points)
Which is the following is not contained in an activation record?
Question 5 options:
Local variables
Global variables
Parameters
Temporary variables
Save
Question 6 (5 points)
For which of the following parameter passing techniques can the argument be a constant or an
expression?
Question 6 options:
Call by value
Call by result
Call by reference
Call by value-result
Save
Question 7 (5 points)
Which of the following function prototypes would be permitted for a C or C++ function with a
multidimensional array parameter?
Question 7 options:
void f(int matrix [10])
void f(int matrix)
void f(int matrix )
void f(int matrix [10])
Save
Question 8 (5 points)
In which of the following languages is it impossible to write a subprogram that swaps two parameters of a
primitive integer type?
Question 8 options:
Java
Ada
C
C++
Save
Question 9 (5 points)
Which of the following languages does not permit operator overloading?
Question 9 options:
Java
C#
Ada
C++
Save
Question 10 (5 points)
Which of the following languages does not permit subprograms or pointers to them to be passed as
parameters?
Question 10 options:
Ada
Pascal
C++
Java
Save
Question 11 (5 points)
What kind of method does the following Java method signature define? public static <T> sort(T array);
Question 11 options:
An abstract method
An overloaded method
A generic method
A nested method
Save
Question 12 (5 points)
Pass-by-result is an implementation model for which parameter mode?
Question 12 options:
in
out-in
out
in-out
Save
Question 13 (5 points)
Which all the following parameter passing techniques can not be used to pass data in and back out from
a subprogram?
Question 13 options:
Call-by-value
Call by value-result
Call by name
Call by reference
Save
Question 14 (5 points)
Which of the following languages does not allow default parameters?
Question 14 options:
C++
Java
Ada
C#
Save
Question 15 (5 points)
Which of the following languages permits nested subprograms?
Question 15 options:
Ada
Java
C
C++
Save
Question 16 (5 points)
Which type of variables are stored in activation records?
Question 16 options:
Static global variables
Heap-dynamic variables
Stack-dynamic local variables
Heap global variables
Save
Question 17 (5 points)
When a language allows nested subprograms, which of the following techniques can be used to
implement the storage of their local variables?
Question 17 options:
Blocks
Parameter chains
Dynamic chains
Static chains
Save
Question 18 (5 points)
Which of the following best describe the relative complexity of implementing nested subprograms
compared to nested blocks.
Question 18 options:
Implementing nested subprograms is simpler
Implementing nested blocks is simpler
They are both equally complex
It depends upon the length of the block or subprogram
Save
Question 19 (5 points)
What C++ parameter passing technique can be used in place of call-by-value when it is desirable to avoid
making a copy of the parameter?
Question 19 options:
by result
by value-result
by reference
by constant reference
Save
Question 20 (5 points)
Which of the following is the correct statement about parameter passing in Java?
Question 20 options:
primitives are passed by value and object are passed by reference
everything is passed by value
the programmer can code passing by value or reference
everything is passed by reference
Save
-
Rating:
/5
Solution: Which of the following parameter passing techniques involves copying the argument