CIS C++ Chapter 6 Quiz
Look at the following function prototype: int myFunction(double, double, double); How many parameter variables does this function have?
3
In a function header, you must furnish:
All of these { data type(s) of the parameters, data type of the return value, the name of function, name of parameter variables }
These types of arguments are passed to parameters automatically if no argument is provided in the function call.
Default
EXIT_FAILURE and ___ are named constants that may be used to indicate success or failure when the exit() function is called.
EXIT_SUCCESS
___ functions may have the same name, as long as their parameter lists are different.
Two or more
A(n) ___ is information that is passed to a function, and a(n) ___ is information that is received by a function.
argument, parameter
A function is executed when it is:
called
A function ___ contains the statement that make up the function.
definition
It is a good programming practice to ___ your functions by writing comments that describe what they do.
document
Look at the following function prototype: int myFunction(double); What is the data type of the function's parameter variable?
double
This function causes a program to terminate, regardless of which function or control mechanism is executing.
exit()
A ___ variable is declared outside all functions.
global
Look at the following function prototype. int myFunction(double); What is the data type of the function's return value?
int
This type of variable is defined inside a function and is not accessible outside the function.
local
If a function is called more than once in a program, the values stored in the function's local variables do not ___ between function calls.
persist
A function ___ eliminates the need to place a function definition before all calls to the function.
prototype
When used as parameters, these types of variables allow a function to access the parameter's original argument.
reference
This statement causes a function to end.
return
The value in this type of local variable persists between function calls.
static
Which of the following statements about global variables is true?
A global variable can have the same name as a variable that is declared locally within a function.
Functions are ideal for use in menu-driven programs. When a user selects a menu item, the program can ___ the appropriate function.
call
This is a collection of statements that preforms a specific task.
function
This is a statement that causes a function to execute.
function call
A function can have zero to many parameters, and it can return this many values.
only one