2.1.4 How to manage variables within a program Flashcards

1
Q

Define:

Scope

A

“Where a variable can be accessed within a program”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Fill The Blank:

A ………. variable is only accessable in a pre-determined part of a program

A

Local

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Fill The Blank:

Two variables can use the same identifier if they are in different ………. because they are in a seperate area in ………

A

Scopes, RAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill The Blank:

The scope of a local variable is the ………… where it has been ………..

A

Subprogram, Declared

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Fill The Blank:

The scope of a global variable is the …………. program

A

Complete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

State:

Where global variables are declared

A

Start of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

State:

Where local variables are declared

A

Declared within subroutines or programming blocks and can only be used within the scope it is declared in

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define:

Snakecase

A

Where words are delimited using underscores: Variable_a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define:

Camelcase

A

All words are started with a capital letter, apart from the first word with no spaces: variableA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Define:

Pascalcase

A

words are started by capital letters: VariableA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define:

Hungarian Notation

A

Describe the purpose and/ore type of variable at the start followed by a descriptor that states the function of the variable: iStudentMarks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fill The Blank:

It is important variable names are ……………. and easily ……………… and understandable.

A

Consistent, Readable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly