Return Exam
Introduction to functions
examples of built in functions
- sqrt
& other math functions
void - verb names
non-void - noun names - must return a
value
function signature (aka. declaration/definition)
vs function call
arguments and parameters
-
parameter - part of the function's signature
- argument
- part of the function call
non-void functions can only return one value but
can have multiple return statements
//function aka method, routine,
sub-routine, sub
Why use functions?
-
documentation
-
modularization aka componentization aka hiding the mess
- reuse -
saves time and is more reliable
- reduces
complexity: Functions can simplify a program greatly and make it
easier to understand what is happening, and program tend to be
shorter
Examples
none
Assign
Homework
Read Chapter 5 sections 1-10