AQA · GCSE · Computer Science
Course version: 8525 · Version from Sept 2020
Students should know why named constants and variables are used.
Full specification wording
Programming concepts: Students should know why named constants and variables are used.
This criterion asks you to explain the purpose of named constants and named variables in programs.
Checked against the AQA 8525 specification (opens in a new tab) on .
- Point 8 of 23
Study notes
From the checked teaching notes for this specification point.
The idea
This criterion asks you to explain the purpose of named constants and named variables in programs. A variable is a named store whose value can change while the program runs, for example a score that increases each time a player answers correctly. A constant is a named store whose value is set once and should not change, for example a VAT rate or the maximum size of a list. Naming them makes code readable, because the name describes the data, and makes it maintainable, because changing the value in one place updates every use. Constants also prevent accidental changes to values that must stay fixed. A good answer distinguishes the two by whether the value is intended to change, and gives a reason such as readability, reuse or preventing errors.
What earns the marks
- States that a variable is a named store whose value can change during execution.
- States that a constant is a named value that is set once and should not be changed while the program runs.
- Explains that meaningful names make code easier to read and understand.
- Explains that using a named constant means a fixed value is defined in one place, so it is easier to change and less likely to be altered by accident.
- Gives a suitable example, such as a score variable that changes or a fixed tax rate held as a constant.
Common mistakes and how to put them right
Confusing constants with variables by saying a constant can be changed when needed.
Put it right: A constant is intended to stay fixed.
Thinking names are only for the computer's benefit.
Put it right: Names mainly help people read and maintain the code.
Believing a variable must always change.
Put it right: It is allowed to change, not required to.
Exam tips
- Decide whether the value is meant to change during the program; if not, it is a constant.
- Link each reason to a benefit such as readability, easier maintenance or preventing accidental change.
- Use a concrete example to show you understand the difference between the two.
Try the lesson
The start of the Programming concepts: Students should know why named constants and variables are used. lesson, made from checked teaching notes for this specification point.
Have a go first
A program stores a player's score, which rises during the game, in a named location called score. Why is a variable the appropriate choice for this value?
There is more to this lesson
The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Test your understanding of Programming concepts: Students should know why named constants and variables are used.
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge