Return To COSI 216 -  Home
Return To Course Outline
 

Functions:

Exercise:

1.  What three things must be specified in a function header?

    2.  Write the function header for the following event.  The function name is GoNext
This function will return the next number of the caller’s number.  For example, the caller passes 10
to GoNext function and GoNext function will return 11 to the caller.

    3.  This problem is related to the last problem.  In the main function, there are two integer boxes, Q and R
The programmer wants to store user’s number in Q then call GoNext function to get the next number
and store the answer in the R.  What statement should the programmer write to call function GoNext
and store the return value to R?

Samples for quiz on functions:
sample1sample2