Please enable JavaScript.
Coggle requires JavaScript to display documents.
Subroutines (Functions (Similar to subroutines but return a value,…
Subroutines
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
It is good practise to use local variables
A global variable can be used anywhere in the program
Global variables should be used only when completely necessary
Functions
INPUTS VALUE
RETURNS VALUE
Procedures
INPUTS VALUE
Does not return a value