Comp1-variable roles. Flashcards

1
Q

What is a fixed value variable?

A

The role of a variable is a fixed value if its value is not changed while the program is running after initialization.
(its changed at the start)

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

What is a stepper variable?

A

Stepper goes through a succession of values in some systematic way.

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

What is a most-recent holder?

A

A variable is a most-recent holder if its value is the latest gone through value of a certain group or simply the latest input value.

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

What is a most wanted holder?

A

The value of a most-wanted holder is the best or otherwise the most-wanted value out of the values gone through so far. could be the smallest number or biggest , the best is defined by the programs needs.

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

What is a gatherer variable?

A

The value of a gatherer is to accumulate all the values gone through so far.

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

what is a follower variable?

A

A follower always gets the old value of another known variable as its new value.

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

What is a transformation variable?

A

A variable is a transformation variable if it always gets its new value from a fixed calculation of values of other variables.

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

What is a temporary variable?

A

A variable is a temporary if its value is always needed only for a very short period.

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

Whats the difference between a value parameter and a reference parameter.

A

Value parameters are used to pass values into a subroutine. Reference parameters are variables use to pass information in and out of a subroutine. They enable the subroutine to change the values of the variables in the calling block.

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

Why use local variables instead of global variables?

A

Easier reuse of routines in other programs;
Routine can be included in a library;
Helps to make the program code more understandable; routine is independent of the rest of the program;
(Global variables use memory while a program is running) reduces possibility of undesirable side effects;
Using global variables makes a program harder to debug;

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

Why can local and global variables have the same identifier?

A

They are stored in different memory locations

the local takes priority from inside the subroutine.

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