AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Programming concepts: assignment

    Assignment stores a value in a named variable so it can be used and changed later in a program.

    Checked against the AQA 8525 specification (opens in a new tab) on .

    • Point 4 of 23

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    Assignment stores a value in a named variable so it can be used and changed later in a program. In AQA 8525 pseudocode the assignment operator is ←, so a statement such as total ← 0 places the value 0 into the variable total, and score ← score + 10 reads the current value of score, adds 10 and stores the result back into score. Distinguish assignment from comparison: = tests equality in a condition, while ← assigns. Choosing a meaningful identifier and a suitable data type (integer, real, string, Boolean, character) keeps the stored value usable. A multiple-choice question may ask which statement correctly assigns a value, what a variable holds after a sequence of assignments, or why an assignment differs from a comparison.

    What earns the marks

    • Identifies ← as the assignment operator in AQA pseudocode and distinguishes it from = used for comparison.
    • Explains that assignment stores a value into a named variable for later use.
    • Traces a sequence of assignments correctly, including a self-referencing statement such as score ← score + 10.
    • Recognises that the data type of the value assigned must suit the variable's intended use.
    • Rejects an option that confuses assignment with a comparison test in a condition.

    Common mistakes and how to put them right

    • Treating = as assignment in AQA pseudocode.

      Put it right: ← assigns and = compares.

    • Reading score ← score + 10 as replacing score with 10.

      Put it right: The old value is read, 10 added, and the result stored.

    • Assuming a variable keeps its original value after a later assignment.

      Put it right: The most recent assignment overwrites it.

    Exam tips

    • Underline the assignment operator in each option before deciding which is correct.
    • Work through any sequence line by line, writing the current value of each variable after every assignment.
    • Check whether a statement is assigning a value or testing a condition, since that decides the answer.

    Try the lesson

    The start of the Programming concepts: assignment lesson, made from checked teaching notes for this specification point.

    Have a go first

    A variable score currently holds the value 10. The program runs the line score = 25. What does score hold after this line executes?

    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.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Programming concepts: assignment

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge