Subroutines

Functions

Procedures

INPUTS VALUE

RETURNS VALUE

INPUTS VALUE

Does not return a value

Functions

Similar to subroutines but return a value

Functions can be stored seperatly to the subroutine

Using one saves writing the same lines of code multiple times

Code contains fewer lines

Parameters

Works like a variable

Identifies the data you want a subroutine to use

The argument is the value being passed to the subroutine

A block interface is used

A block of code that specifies the type of the data

Local/Global variables

A local variable only exists in the subroutine/function it was declared

A global variable can be used anywhere in the program

It is good practise to use local variables

Global variables should be used only when completely necessary