AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Arithmetic operations in a programming language: addition

    Addition is the arithmetic operator that combines two numeric values into their total.

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

    • Point 2 of 8

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    Addition is the arithmetic operator that combines two numeric values into their total. In a programming language it is written with the plus symbol, for example total ← price + postage, where the values stored in price and postage are added and the result is assigned to total. Learners must recognise that addition works on the values held in variables at the moment the line runs, not on the variable names, and that the result is a single new value. They should be able to read a short line of code, identify which two operands are being added, and state the resulting value, including where the operands are variables, constants or literal numbers. Addition may also join strings in some languages, so learners should focus on the numeric case required here and check the data types involved.

    What earns the marks

    • Identifies the plus symbol as the operator that performs addition in a program.
    • States that addition combines two numeric operands to produce their sum.
    • Evaluates a short expression such as 7 + 5 and gives the correct total of 12.
    • Explains that the values held in variables are added, not the variable names themselves.
    • Recognises that the result of an addition can be assigned to a variable for later use.

    Common mistakes and how to put them right

    • Treating the variable name as a number.

      Put it right: Substitute the current value of each variable before adding.

    • Confusing addition with concatenation when strings are involved.

      Put it right: Check the data type and only add numerically when both operands are numbers.

    • Ignoring operator order in a longer expression.

      Put it right: Apply the language's precedence rules, doing multiplication before addition.

    Exam tips

    • Read the line of code and write the current value of each variable above it before calculating.
    • Show the substitution step, for example 7 + 5 = 12, so the working is clear.
    • Check the data types of both operands before deciding that addition is the correct operation.

    Try the lesson

    The start of the Arithmetic operations in a programming language: addition lesson, made from checked teaching notes for this specification point.

    Have a go first

    A program stores the integer 7 in a variable called total and then executes the statement total = total + 5. What value does total hold afterwards?

    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 Arithmetic operations in a programming language: addition

    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