CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

How do you make functions?

  • function header - gives a name, explain parameters
  • function body - explains what you really want done

syntax:

void  <function_name> ( <parameter list>)

{

<statements>

}

  • function_name - you choose a valid name for your function;
  • statements - C++ statements describing the action you want.
  • parameter list - may be empty, or may consist of object declarations separated by comma.

example: jumpjack, line, square