Pearson Edexcel · GCSE · Computer Science

    Course version: 1CP2 · Version from Sept 2020

    Understand the need for and be able to follow and write algorithms that…

    Full specification wording

    Algorithms: 1.2.3 understand the need for and be able to follow and write algorithms that use arithmetic operators (addition, subtraction, division, multiplication, modulus, integer division, exponentiation), relational operators (equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to) and logical operators (AND, OR, NOT)

    Algorithms need operators to turn stored data into decisions and results.

    Checked against the Pearson Edexcel 1CP2 specification (opens in a new tab) on .

    • Point 1 of 4
    • 4 key terms

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    Algorithms need operators to turn stored data into decisions and results. Arithmetic operators compute values: addition combines, subtraction finds a difference, multiplication scales, division gives a quotient, modulus returns the remainder, integer division discards the fractional part, and exponentiation raises a base to a power such as 2³ = 8. Relational operators compare two values and yield true or false: equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to. Logical operators combine or invert Boolean results: AND is true only when both inputs are true, OR is true when at least one is true, and NOT reverses a single Boolean.

    For example: A program accepts a score, then tests score ≥ 50 AND score ≤ 100 to decide whether the mark is valid.

    What earns the marks

    • Addition combines two values, for example total ← total + price.
    • Subtraction finds a difference, for example change ← paid − cost.
    • Multiplication scales a value, for example area ← length × width.
    • Division produces a quotient that may include a fractional part, for example average ← total ÷ count.
    • Modulus returns the remainder after division, for example 17 MOD 5 gives 2.
    • Integer division discards the fractional part, for example 17 DIV 5 gives 3.
    • Exponentiation raises a base to a power, for example 2³ = 8.
    • Relational operators compare values and produce true or false: equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to.
    • AND is true only when both operands are true; OR is true when at least one operand is true; NOT reverses a Boolean value.
    • A correct answer selects the operator whose meaning matches the stated task, such as using modulus to test divisibility.

    Common mistakes and how to put them right

    • Confusing modulus with division.

      Put it right: Modulus returns the remainder, so 17 MOD 5 is 2, while 17 DIV 5 is 3.

    • Treating integer division as ordinary division.

      Put it right: Integer division discards the fractional part, so 17 DIV 5 is 3, not 3.4.

    • Assuming OR is true only when exactly one operand is true.

      Put it right: OR is true when at least one operand is true, so true OR true is true.

    • Reading NOT as a comparison rather than an inversion.

      Put it right: NOT reverses a single Boolean value, so NOT true is false.

    Exam tips

    • Underline the key word in the question, such as remainder, quotient or power, before choosing an operator.
    • Work out each expression step by step, applying brackets and operator precedence before comparing values.
    • Check Boolean expressions by substituting true and false for each operand and evaluating the logical operators last.

    Try the lesson

    The start of the Algorithms: 1.2.3 understand the need for and be able to follow and write algorithms that use arithmetic operators (addition, subtraction, division, multiplication, modulus, integer division, exponentiation), relational operators (equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to) and logical operators (AND, OR, NOT) lesson, made from checked teaching notes for this specification point.

    Have a go first

    An algorithm sets a variable to 17 and then calculates 17 MOD 5. What value does the algorithm produce?

    Listen

    Algorithms need operators to turn stored data into decisions and results. Arithmetic operators compute values: addition combines, subtraction finds a difference, multiplication scales, division gives a quotient, modulus returns the remainder, integer division discards the fractional part, and exponentiation raises a base to a power such as 2³ = 8. Relational operators compare two values and yield true or false: equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to. Logical operators combine or invert Boolean results: AND is true only when both inputs are true, OR is true when at least one is true, and NOT reverses a single Boolean. For example, a program accepts a score, then tests score ≥ 50 AND score ≤ 100 to decide whether the mark is valid. A strong answer earns marks for these points. Addition combines two values, for example total ← total + price. Subtraction finds a difference, for example change ← paid − cost. Multiplication scales a value, for example area ← length × width. Division produces a quotient that may include a fractional part, for example average ← total ÷ count. Exam tip: Underline the key word in the question, such as remainder, quotient or power, before choosing an operator.

    See it

    A top-down flowchart. The top node 'Operators' branches into three nodes: 'Arithmetic operators', 'Relational operators' and 'Logical operators'. The arithmetic node branches into two nodes: 'Addition, subtraction, multiplication, division' and 'Modulus, integer division, exponentiation'. The relational node leads to one node: 'Compare two values, yield true or false'. The logical node branches into three nodes: 'AND: true only when both inputs true', 'OR: true when at least one input true' and 'NOT: reverses a single Boolean'.
    It classifies the three groups of operators in the note and what each group does.

    Key words

    Say what each word means before you turn the card.

    Arithmetic operators

    Try answering aloud or in your head before turning the card.

    Relational operators

    Try answering aloud or in your head before turning the card.

    Logical operators

    Try answering aloud or in your head before turning the card.

    Modulus

    Try answering aloud or in your head before turning the card.

    See every definition
    Arithmetic operators
    Operators that compute values: addition combines, subtraction finds a difference, multiplication scales, division gives a quotient, modulus returns the remainder, integer division discards the fractional part, and exponentiation raises a base to a power.
    Relational operators
    Operators that compare two values and yield true or false: equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to.
    Logical operators
    Operators that combine or invert Boolean results: AND is true only when both inputs are true, OR is true when at least one is true, and NOT reverses a single Boolean.
    Modulus
    Returns the remainder after division, for example 17 MOD 5 gives 2.

    Label the diagram

    Some boxes have lost their names. Pick the right name for each number.

    The diagram again, with 3 boxes numbered instead of named. A top-down flowchart. The top node 'Operators' branches into three nodes: 'Arithmetic operators', 'Relational operators' and 'Logical operators'. The arithmetic node branches into two nodes: 'Addition, subtraction, multiplication, division' and 'Modulus, integer division, exponentiation'. The relational node leads to one node: 'Compare two values, yield true or false'. The logical node branches into three nodes: 'AND: true only when both inputs true', 'OR: true when at least one input true' and 'NOT: reverses a single Boolean'.
    • 1Box 1

    • 2Box 2

    • 3Box 3

    0 of 3 labelled

    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 Algorithms: 1.2.3 understand the need for and be able to follow and write algorithms that use arithmetic operators (addition, subtraction, division, multiplication, modulus, integer division, exponentiation), relational operators (equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to) and logical operators (AND, OR, NOT)

    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