USER-DEFINED FUNCTIONS Flashcards
To use a predefined function in a program, you need to know only the name of the function and how to use it.
False
A value-returning function returns only one value.
True
Parameters allow you to use different values each time the function is called.
True
When a return statement executes in a user-defined function, the function immediately exits.
True
A value-returning function returns only integer values.
False
When a return statement executes in a user-defined function, the function immediately exits.
True
A value-returning function returns only integer values.
False
A variable name cannot be passed to a value parameter
False
If a C++ function does not use parameters, parentheses around the empty parameter list are still required.
True
In C++, the names of the corresponding formal and actual parameters must be the same.
False
A function that changes the value of a reference parameter also changes the value of the actual parameter
True
Whenever the value of a reference parameter changes, the value of the actual parameter changes.
True
In C++, function definitions can be nested; that is, the definition of one function can be enclosed in the body of another function.
False
Using global variables in a program is a better programming style than using local variables, because extra variables can be avoided.
False
In a program, global constants are as dangerous as global variables.
False