4.1.1.6 Constants and variables in a programming language Flashcards

1
Q

What is meant by a variable?

A

A name in memory with an identifier that stores a value which can be changed during the program.

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

What is a constant?

A

A value defined at the start that can’t be changed during execution of the program.

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

What’s the advantage of using constants?

A

It improves the readability of code and makes the code easier to update as only the declaration of the constant at the start needs changing. This reduces errors and makes debugging easier.

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