Our previous program had two functions. Can you parse them into
the above parts?
The function-type declares what variable type the function returns
when it is used (or called). To call a function, just use the
function's name and pass it the correct number and type of
values inside of parantheses.
The function-name can be any valid identifier.
The declaration-of-function-arguments specifies the input of
the function. Each input is given a name (identifier) by which it can
be refered inside the function, and a type.
Similarly, the local-variable-declarations contains the declarations
of variables to be used inside the function and the function-statements
do the work of the statement.
At least one of the function-statements should be a return
statement, which specifies the return value of the function. The return
value should be of the same type as the function's type.
You can have as many return statements in a function as you
want, but things are generally much clearer if you have only one at the
end of the function.