CSE 100 EXAM 2 QUESTIONS AND
ANSWERS RATED A 100% VERIFIED.
True/False: When you make a function call, the order of the arguments you send
does not matter as long as the number of arguments matches the number of
parameters the function has.
False
When only a copy of an argument is passed to a function, it is said to be passed
A) by copy.
B) by reference.
C) informally.
D) by value.
E) by default value.
D) by value.
When a function needs access to an original argument passed to it, for example in
order to change its value, the argument needs to be
A) passed by value.
B) passed into a reference parameter.
C) a static variable.
D) an integer.
E) a constant.
B) passed into a reference parameter.
A function ________ eliminates the need to place the function definition before all
calls to the function.
A) header
B) prototype
C) argument
D) parameter
E) that is void
,B) prototype
A ________ variable is declared outside all functions.
A) local
B) global
C) static
D) counter
E) constant
B) global
In the following statement, what is 22.0?
cout << sqrt(22.0);
A) A memory location.
B) A parameter.
C) An argument.
D) A default value.
E) An lvalue.
C) An argument.
True/False: Although global variables can be useful, it is considered good
programming practice to restrict your use of them.
True
True/False: Both function headers and function calls must list the data types of all
data being passed to the function.
False
A(n) ________ argument is one that is automatically passed to a parameter when
the argument is left out of the function call.
A) floating-point
B) actual
C) null
D) default
E) static
, D) default
True/False: In C++ global and local numeric variables are initialized to zero by
default.
False
A static local variable is one
A) whose value never changes.
B) whose value is retained between function calls.
C) with the same name as a global variable.
D) whose scope is limited to the function it is defined in.
E) that is reinitialized each time the function it is defined in is called.
B) whose value is retained between function calls.
An overloaded function is one
A) that calls other functions.
B) that has the same name as another function.
C) that has too many parameters.
D) that attempts to do too much in a single function.
E) that does different things depending on who calls it.
B) that has the same name as another function.
True/False: You may use the exit() function to return the flow of control from a
function back to main() regardless of where the function was called from.
False
A ________ is a dummy function that is called instead of the actual function it
represents, to test that the call to and return from the function are working
correctly.
A) stub
B) driver
C) test function
D) void function
E) prototype function
ANSWERS RATED A 100% VERIFIED.
True/False: When you make a function call, the order of the arguments you send
does not matter as long as the number of arguments matches the number of
parameters the function has.
False
When only a copy of an argument is passed to a function, it is said to be passed
A) by copy.
B) by reference.
C) informally.
D) by value.
E) by default value.
D) by value.
When a function needs access to an original argument passed to it, for example in
order to change its value, the argument needs to be
A) passed by value.
B) passed into a reference parameter.
C) a static variable.
D) an integer.
E) a constant.
B) passed into a reference parameter.
A function ________ eliminates the need to place the function definition before all
calls to the function.
A) header
B) prototype
C) argument
D) parameter
E) that is void
,B) prototype
A ________ variable is declared outside all functions.
A) local
B) global
C) static
D) counter
E) constant
B) global
In the following statement, what is 22.0?
cout << sqrt(22.0);
A) A memory location.
B) A parameter.
C) An argument.
D) A default value.
E) An lvalue.
C) An argument.
True/False: Although global variables can be useful, it is considered good
programming practice to restrict your use of them.
True
True/False: Both function headers and function calls must list the data types of all
data being passed to the function.
False
A(n) ________ argument is one that is automatically passed to a parameter when
the argument is left out of the function call.
A) floating-point
B) actual
C) null
D) default
E) static
, D) default
True/False: In C++ global and local numeric variables are initialized to zero by
default.
False
A static local variable is one
A) whose value never changes.
B) whose value is retained between function calls.
C) with the same name as a global variable.
D) whose scope is limited to the function it is defined in.
E) that is reinitialized each time the function it is defined in is called.
B) whose value is retained between function calls.
An overloaded function is one
A) that calls other functions.
B) that has the same name as another function.
C) that has too many parameters.
D) that attempts to do too much in a single function.
E) that does different things depending on who calls it.
B) that has the same name as another function.
True/False: You may use the exit() function to return the flow of control from a
function back to main() regardless of where the function was called from.
False
A ________ is a dummy function that is called instead of the actual function it
represents, to test that the call to and return from the function are working
correctly.
A) stub
B) driver
C) test function
D) void function
E) prototype function