Please enable JavaScript.
Coggle requires JavaScript to display documents.
Procedures and Functions ((Global variables (a global variable is a…
Procedures and Functions
-
-
Procedures
-
-
-
-
They are activated by a call from the main program. When a procedure is called it produces an effect.
Functions
As well as using pre-defined functions we can write our own
A Function consists of:
-A Heading
-A Declaration part
-An Action part
A function is activated by a call from the main program.
A function returns a single value
Global variables
a global variable is a variable with global scope, meaning that it is visible (hence accessible) throughout the program, unless shadowed.
Local Variables
A local variable is a variable which is either a variable declared within the function or is an argument passed to a function.
Parapeters
Formal Variables are
Formal parameters must have names differing from those of external variables and local variables defined within one function.
-