2.1.4 How to manage variables within a program Flashcards
Define:
Scope
“Where a variable can be accessed within a program”
Fill The Blank:
A ………. variable is only accessable in a pre-determined part of a program
Local
Fill The Blank:
Two variables can use the same identifier if they are in different ………. because they are in a seperate area in ………
Scopes, RAM
Fill The Blank:
The scope of a local variable is the ………… where it has been ………..
Subprogram, Declared
Fill The Blank:
The scope of a global variable is the …………. program
Complete
State:
Where global variables are declared
Start of the program
State:
Where local variables are declared
Declared within subroutines or programming blocks and can only be used within the scope it is declared in
Define:
Snakecase
Where words are delimited using underscores: Variable_a
Define:
Camelcase
All words are started with a capital letter, apart from the first word with no spaces: variableA
Define:
Pascalcase
words are started by capital letters: VariableA
Define:
Hungarian Notation
Describe the purpose and/ore type of variable at the start followed by a descriptor that states the function of the variable: iStudentMarks
Fill The Blank:
It is important variable names are ……………. and easily ……………… and understandable.
Consistent, Readable