SLIDE 1 / 10
CSZone.co.uk
Click anywhere to advance · Arrow keys also work
AQA 7517 · Paper 1 · 4.1.1d

Sequence, Assignment
& Input / Output

AQA A-Level Computer Science · Section 4.1 Fundamentals of Programming

WHAT YOU'LL LEARN
Sequence construct · Assignment operator ← · USERINPUT & OUTPUT
AQA SPEC LINK
4.1.1 — Three constructs: sequence, selection, iteration
Sequence

Sequence — The First Construct

In sequence, instructions execute one after another, in the order written. Every line runs — no skipping.
AQA EXAMPLE
name ← USERINPUT
age ← INT(USERINPUT)
OUTPUT "Hello " + name
OUTPUT "You are " + STR(age) + " years old"
Selection and iteration are exceptions to pure sequence — they alter the flow of execution.
Assignment

The Assignment Operator ←

HOW IT WORKS
Right side evaluated first, result stored in left side variable.

x ← 5
x ← x + 1 → x becomes 6
⚠️ IMPORTANT
x ← x + 1 is NOT a maths equation. It means "take x, add 1, store result back in x". AQA uses ← ; Python uses =
INPUT

Getting Input — USERINPUT

AQA PSEUDOCODE
name ← USERINPUT
age ← INT(USERINPUT)
score ← REAL(USERINPUT)
PYTHON
name = input()
age = int(input())
score = float(input())
USERINPUT always returns a STRING. Cast to INT or REAL before arithmetic!
OUTPUT

Displaying Output

AQA PSEUDOCODE
OUTPUT "Hello, World!"
OUTPUT "Score: " + STR(score)
OUTPUT name + " scored " + STR(score) + "%"
CONCATENATION RULE
Use + to join strings. Numbers must be wrapped in STR() first.
PYTHON PRINT
print("Hello!")
print(f"Score: {score}")
print(name, "scored", score)
Full Program

Sequence: Complete Example

TEMPERATURE CONVERTER (°C → °F)
OUTPUT "Enter temperature in Celsius:"
celsius ← REAL(USERINPUT)
fahrenheit ← (celsius * 9/5) + 32
OUTPUT STR(celsius) + "°C = " + STR(fahrenheit) + "°F"
Pure sequence — 4 lines, each executed in order. Note: cast USERINPUT to REAL; use STR() before concatenation.
Trace Table

Tracing Sequential Code

a ← 10    b ← 3    c ← a * b + 2    a ← a + b    OUTPUT a, b, c
LineabcOutput
a ← 1010
b ← 3103
c ← a*b+210332
a ← a+b13332
OUTPUT1333213, 3, 32
Common Errors

Avoid These Mistakes

❌ Using variable before assigning
OUTPUT score
score has no value yet — assign first
❌ Forgetting type casting on input
total ← USERINPUT + 10
Fix: total ← INT(USERINPUT) + 10
❌ Concatenating number without STR()
OUTPUT "Answer: " + result
Fix: OUTPUT "Answer: " + STR(result)
AQA Exam Style

Practice Question

AQA 7517 — Paper 1 Style
A student writes:
num1 ← INT(USERINPUT)
num2 ← INT(USERINPUT)
total ← num1 + num2
average ← total / 2
OUTPUT "Average: " + STR(average)
The user enters 7 then 13. What is the output?
[2 marks]
1 mark
total = 20; average = 20 / 2 = 10.0
1 mark
Output: Average: 10.0
Summary

Key Points to Remember

Sequence — instructions execute in written order, top to bottom
Assignment ← — evaluate right, store in left. AQA uses ← ; Python uses =
USERINPUT — always returns STRING; cast with INT() or REAL()
OUTPUT — concatenate with + ; numbers need STR() conversion first
Trace tables: track each variable after every assignment
🎉 Lesson complete — move to the quiz!