Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0984

Write a sequence with assignments

Arrange statements in order so each calculation uses values that have already been assigned.

Section 8 · Programming

Cambridge IGCSE Computer Science 0984 · Programming · 2026–2028 Version 4 · 0984 (9–1) · 8.1
Exam scope and assessment notes

This sequence follows Cambridge IGCSE Computer Science 0984, 2026–2028 syllabus Version 4. It covers section 8.1 (Programming concepts) only. Pseudocode examples use the published Cambridge format; the separate 2029–2031 syllabus is not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers, a browser-based programming workspace and human subject-teacher review remain outstanding. Cambridge states that 0984 has the same 2026–2028 subject content as 0478, with 9–1 grading. In June and November, Cambridge lists 0984 in Administrative zone 3 and for centres in Oman and the UAE. Confirm availability for your centre and exam series with Cambridge International. The separately published 2029–2031 syllabus changes to Python 3 only and removes pseudocode; this 2026–2028 route does not cover those changes.

Before you begin

  • Be comfortable following an ordered algorithm and tracing variable values. Each lesson introduces the Cambridge pseudocode form it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

If A is 3, what does A ← A + 1 do?

What you will learn

  • Trace statements in sequence
  • Use ← to assign a value
  • Update variables without confusing old and new values

Sequence is the order statements run

A computer follows statements from top to bottom unless a selection or loop changes the flow. Each assignment takes effect before the next statement runs.

For example, Total ← Price * Quantity must come after both inputs have values. A later OUTPUT can then display the calculated Total.

An assignment changes the variable on its left

The arrow ← means store the evaluated expression on the right in the variable on the left. The expression can use the variable's current value.

When tracing, write down the value after every assignment. This avoids treating an update such as Counter ← Counter + 1 as an equation to solve.

Pause and explain

Which statement sets Price before calculating Cost = Price × Quantity?

Put the idea to work

Worked example

Trace A ← 4; B ← A + 3; A ← B * 2; OUTPUT A, B.

Show the worked solution
  1. A receives 4.
  2. B receives the current A plus 3, so B becomes 7.
  3. A is then updated to 14; B remains 7.

Answer The output is 14, 7 because assignments run in sequence and B keeps its earlier value.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

Trace X ← 6; Y ← X * 2; X ← X - 1. Give the final values.

Give me a hint

Record each assignment before moving to the next line.

Compare my reasoning
  1. Set X to 6.
  2. Use that value to set Y to 12.
  3. Reduce X by one; Y is unchanged.

X = 5 and Y = 12.

Look for these in your work

  • Order followed
  • Both final values correct
2 · Independent

Write a sequence to calculate the total price for 4 items at a price stored in UnitPrice.

Give me a hint

Multiply the unit price by the number of items after UnitPrice is available.

Compare my reasoning
  1. Declare Quantity and Total as numeric variables.
  2. Set Quantity ← 4.
  3. Set Total ← UnitPrice * Quantity.

Quantity ← 4; Total ← UnitPrice * Quantity.

Look for these in your work

  • Quantity set
  • Multiplication correct
3 · Transfer

A program sets Balance ← 30; Deposit ← 10; Balance ← Balance + Deposit. Explain the final balance and why.

Give me a hint

Follow the last assignment using the current Balance.

Compare my reasoning
  1. Balance starts at 30.
  2. Deposit is set to 10.
  3. The last statement stores 30 + 10 in Balance.

Balance is 40; the final assignment updates the existing value using Deposit.

Look for these in your work

  • Starting values traced
  • Updated value explained

Common mistakes

  • Treating assignment as a two-way equality
  • Updating a variable before its first value is set
  • Assuming a later change to A also changes an earlier copy in B
Recall without your notes

What can you explain now?

After X ← 5 followed by Y ← X + 2, what are X and Y?

Compare with the explanation

X is 5 and Y is 7

The second statement reads X's current value and stores 7 in Y.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

How does a trace table help when several assignments update the same variable?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science (9-1)

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 4 syllabus. Cambridge states that 0984 has the same subject content as 0478, with 9–1 grading. Three retained introductory lessons remain available but are not counted as syllabus-mapped teaching. The 2023–2025 syllabus remains unmapped. The separately published 2029–2031 syllabus changes to Python 3 only and removes pseudocode; this 2026–2028 route does not cover those changes. In June and November, Cambridge lists 0984 in Administrative zone 3 and for centres in Oman and the UAE. Confirm availability for your centre and exam series with Cambridge International. Practical programming in an executable browser workspace, full timed-paper practice and human subject-teacher review remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.