6.6.3: understand the difference between and be able to write programs that make appropriate use of global and local variables
Keyword | Definition |
---|---|
global variable | type of variable which can be accessed from any block of code in a program |
local variable | type of variable which can only be accessed from within the scope of a subprogram or block of code |
parameter | value passed into a subprogram which then behaves like a local variable for the scope of that subprogram |
scope | the block(s) of code where a variable can be accessed (either global or local) |
variable | named memory location which can store a value which can change when the program runs |