6.4: understand the need for, and how to use, global and local variables when implementing subprograms
Keyword | Definition |
---|---|
global variable | a variable which can be accessed from anywhere in a program |
local variable | a variable which can only be read / written within a particular part of a program |
scope | the part of a program where a variable can be accessed. |
variable | memory storage location with a name that can store an individual value. The value can change when the program runs. |