Chapter 5 Flashcards
Function
Group of statements within a program that perform a specific task.
Modular program
Program wherein each task within the program is in its own function.
Void function
Simply executes the statements it contains and then terminates
Value-back function
Simply executes the statements it contains and then terminates
Function Definition
Specifies what a function does.
Function header
First line of function
Block
Set of statements that belong together as a group. MUST BE INDENTED
Formal parameters
Variables in the parentheses when the function is defined.
Arguments
Pieces of data that is sent into a function when you call the function.
The formal parameters and the actual parameters must match in what?
number, order, and data type.
Local variable
Variable that is assigned a value inside a function.
- Belongs to the function in which it was created.
- Only statements inside that function can access it.
Scope
Part of a program in which a variable may be accessed.