Functions

Objectives
In these lessons, students will learn:

  • How functions helps to organize and group code
  • How functions make the code reusable.

What is a Function?
Functions consist of a series of statements that have been grouped together because they perform a specific task.


Calling a Function
The function needs to be called, and you do that with the function name.

Calling Functions that need Information
Sometimes functions need information to work to perform a task.When you declare the function you give it parameters. Functions that take arguments will contain some information about the quantity of arguments they need, along with some hints about the values your argument will take.

Advertisements