Paper 2 exam skills
Paper 2 at a glance
Paper 2: Computational thinking, algorithms and programming covers sections 2.1 to 2.5. It's 80 marks in 1 hour 30 minutes, half your GCSE, without a calculator, in two sections:
- Section A (50 marks, about 50 minutes): concepts, and applying them to problems, perhaps with an algorithm.
- Section B (30 marks, about 40 minutes): designing, writing, testing and refining programs.
| Question style | Section | Marks | AOs | What gets the marks |
|---|---|---|---|---|
| Algorithm, in any form | A | 2–6 | AO2, AO3 | A mark per correct piece of logic |
| Design | B | 2–4 | AO3 | A mark per design point |
| Write | B | 3–8 | AO3 | A mark per correct element of the code |
| Test | B | 2–6 | AO3 | A mark per correct entry or row |
| Refine | B | 2–6 | AO3 | A mark per correct change |
Allow about a minute a mark.
Key terms
Section A: any clear form
In Section A, the logic matters, not the syntax. You can answer an algorithm question in pseudocode, a flowchart, bullet points, plain English, ERL or Python.
Question: Write an algorithm that asks for a whole number and outputs whether it is even or odd. [3]
As bullet points:
- Ask the user for a whole number.
- If the remainder when it's divided by 2 is 0, output "Even".
- Otherwise, output "Odd".
As a flowchart:
In ERL and Python:
number = int(input("Whole number?"))
if number MOD 2 == 0 then
print("Even")
else
print("Odd")
endif
Each earns the same 3 marks: an input, a correct check for even, and both outputs.
Key terms
Section B: the scenario
Section B's questions are often built around one scenario. Here's an original one, used for each question style below.
Scenario: a cinema charges £6 for children under 12, £7 for people aged 65 or over, and £10 for everyone else. It wants a program that works out ticket prices.
Section B: design
Question: Identify the inputs, processes and outputs of the ticket program, and a suitable data type for the input. [4]
Model answer:
| Input | The person's age |
| Process | Compare the age with 12 and 65 to choose the price |
| Output | The ticket price |
| Data type | Integer, as an age is a whole number of years |
What gets the marks: a mark for each correct, relevant point. A data type needs a reason linked to the data. Design answers can be in plain English, pseudocode or a flowchart: the code comes later.
Section B: write
Question: Write a function, ticket_price, that takes a person's age as a parameter and returns the price of their ticket. You must use either OCR Exam Reference Language or a high-level programming language. [4]
Model answer:
function ticket_price(age)
if age < 12 then
return 6
elseif age >= 65 then
return 7
else
return 10
endif
endfunction
What gets the marks:
- a function with an age parameter;
- the under-12 check, with the right boundary (
< 12); - the 65-or-over check (
>= 65); - returning the right price in every case, rather than printing it.
Minor syntax slips, such as a missing colon, aren't penalised, but each construct must be recognisable: strings in quotation marks, = for assignment, and names with no spaces.
Exam tip
When a Section B question says to use ERL or a high-level language, answer in ERL or a real language such as Python. Pseudocode or plain English gets no marks there.
Section B: test
Question: Complete the test plan for the ticket program, which should accept ages from 0 to 120. [4]
Model answer:
| Test data | Type | Expected result |
|---|---|---|
| 30 | Normal | £10 |
| 11 and 12 | Boundary | £6, then £10 |
| 64 and 65 | Boundary | £10, then £7 |
| −3 | Invalid | Rejected with an error message |
| ten | Erroneous | Rejected with an error message |
What gets the marks: test data of the type asked for, each with the right expected result. Boundary data tests each side of every boundary, as that's where mistakes such as < instead of <= show up.
Section B: refine
Question: This program works out the cost for exactly three people. Refine it so it works for any number of people. You must use either OCR Exam Reference Language or a high-level programming language. [4]
total = 0
age = int(input("Age of person 1?"))
total = total + ticket_price(age)
age = int(input("Age of person 2?"))
total = total + ticket_price(age)
age = int(input("Age of person 3?"))
total = total + ticket_price(age)
print("Total: £" + str(total))
Model answer:
people = int(input("How many people?"))
total = 0
for i = 1 to people
age = int(input("Age?"))
total = total + ticket_price(age)
next i
print("Total: £" + str(total))
What gets the marks: asking how many people; a loop that runs that many times; adding each price to the total inside the loop; and printing the total after it.