Functions Flashcards
To introduce the concept of void functions (procedures) 2. To work with void functions (procedures) that have no parameters 3. To introduce and work with void functions (procedures) that have pass by value and pass by reference parameters
A key element of structured (well organized and documented) programs is their
_____.
modularity
modularity is the breaking of code into
small units.
void functions do not ___
return a value
The int main() section of our program is a function and, up until now, has been the only ___ used in our programs.
coded module
We also have used _____such as pow and sqrt which are defined in library routines and “imported” to our program with the #include directive.
pre-defined functions
We now explore the means of breaking our own code into modules. The main function
should contain little more than ____ to other functions.
“calls”
Calling a function basically means starting the ____ contained in that module..
execution of the instructions
Sometimes a function may need information _____ in order to perform designated tasks.
“passed”
Information is passed to or from a function through __.
parameters.
Parameters are the ___ between functions.
components of communication
_______ printDescription(); // ____________
type functionname(); // Function prototype
int main() { cout << "Welcome to the Payroll Program." << endl; functionname(); // \_\_\_\_\_\_\_\_\_\_\_\_ return 0; }
functionname(); // Call to the function
void printDescription() // The function heading { // \_\_\_\_ This function prints a program description // \_\_\_\_\_ none }
type functionname() // The function heading // Task: // Data in:
The function heading void printDescription() consists of the _____ of the function preceded by the word _____.
name , void.
The word void means that this function will not _____
return a value to the module that called it.