Example: pass user's input into function as parameter
7.3 Documenting Functions
7.3 Documenting Functions
The essential information includes:
The purpose of the function.
The role of each parameter.
The nature of the return value.
7.4 Function Examples
Question: what is the order of functions being called and what content will be printed ?
7.4 Function Examples
Output:
I am method 1.
I am method 2.
I am method 1.
I am method 1.
I am method 2.
I am method 3.
I am method 1.
I am method 1.
I am method 2.
7.5 Refactoring to Eliminate Code Duplication
7.6 Custom Functions vs. Standard Functions
Generally speaking, if you have the choice of using a standard library function or writing your own custom function that provides the same functionality,