Chapter 6 Quiz – Flashcards

Unlock all answers in this set

Unlock answers
question
The ________ statement causes a function to end and the flow of control to move back to the point where the function call was made.
answer
return
question
When used as a parameter, a ________ variable allows a function to access and modify the original argument passed to it. These kind of variables indicate a call-by-reference.
answer
reference
question
Functions are ideal for use in menu-drive programs. When a user selects a menu item, the program can ________ an appropriate function to carry out the user's choice.
answer
call
question
A function can have zero to many parameters, and it can have ________ return value(s) in the return statement
answer
either zero or one
question
A ________ variable is defined inside the body of a function and is not accessible outside that function.
answer
local
question
A function ________ includes the statements that make up the function. That is, it includes the body of the function which appears within braces.
answer
definition
question
The ________ function causes the entire program to terminate, regardless of which function or control mechanism is executing.
answer
exit()
question
When a function only needs a copy of an argument passed to it, the argument should normally be passed ________.
answer
by value
question
Two or more functions may have the same name provided that ________
answer
their parameter lists are different
question
When more than one function has the same name they are called ________ functions
answer
overloaded
question
True/False: If the closing brace of a function body is reached, the flow of control moves to the next function in the file. That is, the flow of control drops down into the code after the closing brace.
answer
False
question
It is possible for a function to have some parameters with default arguments and some without.
answer
True
question
A void function is one that ________.
answer
returns no value at all of any type
question
Breaking a program up into a set of manageable sized functions is called ________ programming.
answer
modular
question
A ________ is a program module whose purpose is to test other modules by calling them.
answer
driver
question
A function other than the main function is executed ________.
answer
whenever it is called
question
The value in a ________ local variable is retained between function calls. This can be used to count how many times a function is called, among other things.
answer
a static
question
In a function prototype, in addition to the name of the function, you are required to furnish ________.
answer
the number of parameters, the type of each parameter, and the return type of the function.
question
In a function header, in addition to the name of the function, you are required to furnish ________. (Hint: consider the difference between a function prototype and a function header. They are not the same.)
answer
return type and parameter list
question
In a function call, in addition to the name of the function, you are required to furnish ________.
answer
the parameter list.
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New