M7 Flashcards
a group of statements that is
executed when it is called from some point of the
program
function
a self-contained block of code with
a specific purpose. It has a name that is used to
identify and call it for execution.
function
a subprogram that acts on data and
often returns a value.
function
functions are easier to:
maintain, update, and debug
The program that calls a
function is often referred
to as the
calling
program.
One function that every
C++ program possesses:
int main()
is a programmed routine that
has its parameters set by the user of the system
user-defined function
are functions that perform
specific tasks within a larger system, such as a database
or spreadsheet program.
User defined functions
If the function returns a value then the type of that value must be
specified in
return_type
follows the same rules of composition as
identifiers
function_name
lists the formal parameters of the function
together with their types.
parameter_list
are definitions of variables that are used in the
function_implementation.
local_definitions
consists of C++ executable
statements that implement the effect of the function.
function_implementation
If the function does not return a value then the return_type
must be
void.
. These variables have no meaning outside
the function.
local_definitions