Chapter 6 Flashcards
Functions
Breaking a program up into a set of manageable sized functions is called [Blank] programming
modular
A function [Blank] includes the statements that make up the function.
definition
A function other than the main function is executed …
whenever it is called.
True/False: A function can have zero to many parameters and either zero or one return value(s).
True
In a function header, in addition to the name of the function, you are required to furnish …
a data type for each parameter, an identifier name for each parameter, and the data type of the return value. (multiple)
In a function prototype, in addition to the name of the function, you are required o furnish …
a data type for each parameter and the data type of the return value. (multiple)
In a function call, in addition to the name of the function, you are required to furnish …
an identifier name or constant for each argument.
A void function is one that …
returns no value.
True/False: Functions are ideal for use in menu-drive programs. When a user selects a menu item, the program can call an appropriate function to carry out the user’s choice.
True
A [Blank] variable is defined inside the body of a function and is not accessible outside that function.
local
The value in [Blank] local variable is retained between function calls.
a static
True/False: When a function just needs to use a copy of an argument passed to it, the argument should normally be passed by value.
True
When used as a parameter, a [Blank] variable allows a function to access and modify the original argument passed to it.
reference
True/False: It is possible for a function to have some parameters with default arguments and some without.
True
Two or more functions may have the same name provided that …
their parameter lists are different.