Variables vs Constants

Part of Variables & Constants · Section 3 of 7

Study NotesUnit: 3.2 ProgrammingGCSE

This study notes covers Variables vs Constants within Variables & Constants for GCSE Computer Science. Revise Variables & Constants in 3.2 Programming for GCSE Computer Science with 17 exam-style questions and 10 flashcards. This topic appears less often, but it can still be a useful differentiator on mixed-topic papers. It is section 3 of 7 in this topic. Use this study notes to connect the idea to the wider topic before moving on to questions and flashcards.

Variables vs Constants

Aspect Variable Constant
Value can change? Yes - can be reassigned No - fixed once declared
Use for Scores, counters, user input PI, VAT rate, fixed values
Naming convention camelCase or snake_case UPPER_CASE (often)
Example score = 100 const PI = 3.14159

Practice questions for Variables & Constants

Which of the following best describes a variable in a program?

  • A. A named memory location whose value can be changed during execution
  • B. A named memory location whose value cannot be changed once set
  • C. A value that is hard-coded directly into the program instructions
  • D. A fixed mathematical value such as pi or the speed of light
1 markfoundation

Explain three reasons why using named constants is considered good programming practice.

3 marksstandard

Quick recall flashcards

What is a variable?
Named storage location whose value can change
What is a constant?
Named storage location whose value cannot change

17 questions on Variables & Constants — practise free

Instant marking, adaptive difficulty and spaced-repetition flashcards — all aligned to your exam board.

Start revising free →