Exclusive Practice Resource

Monday 25 May 2026 - Afternoon

GCSE (9-1) Computer Science

Unofficial Practice Paper: J277/02 Computational Thinking, Algorithms and Programming [VERSION C]

Time allowed: 1 hour 30 minutes

Centre number
Candidate number
First name(s)
Last name

INSTRUCTIONS

This is an unofficial practice resource created exclusively for gcsecomputerscience.co.uk. It is not endorsed by, affiliated with, or approved by Oxford Cambridge and RSA Examinations (OCR).
Turn over
2

SECTION A

1

(a) Complete the flowchart logic below by filling in the empty boxes and labels. The flowchart should ask for a user's age. If the age is greater than or equal to 18, it outputs "Adult", otherwise it outputs "Child".

Start Is Age >= 18? ( ) ( ) End
[4]

(b) Explain two benefits of using parameters to pass data into a subprogram, rather than using global variables.

[4]
2

(a) Compare the efficiency of a Linear Search to a Binary Search when searching for an item in a very large, sorted array.

[4]

(b) State why a Linear Search must be used if the array contains unsorted data.

[4]
Turn over
3
3

(a) Tick (✓) one box in each row to show whether the statement applies to a Compiler, an Interpreter, or Both.

StatementCompilerInterpreterBoth
Translates high-level code into machine code
Translates and executes the code line-by-line
Produces a final executable file that can be distributed
Stops translating as soon as the first error is found
[4]

(b) Explain why a software company would choose to use a Compiler rather than an Interpreter when releasing their final commercial software to the public.

[4]
4

(a) State the difference between Validation and Verification.

[4]

(b) Identify two methods a programmer can use to improve the maintainability of their code, and state how each method helps.

Method 1:

How it helps:

Method 2:

How it helps:

[4]
Turn over
4
5

(a) Define the term Casting in programming.

[2]

(b) Write a single line of OCR Reference Language to cast the string variable "54" to an integer and store it in a variable called numValue.

[2]

(c) A program uses the string variable sensorStatus = "Warning-Active".

Complete the table to show the output of each string manipulation statement.

StatementOutput
print(sensorStatus.left(7))
print(sensorStatus.length)
print(sensorStatus.substring(8, 6))
print(sensorStatus.upper)
[4]
Turn over
5

SECTION B

Context: Eco-Tech Environmental Monitoring System

6

(a) An environmental alarm triggers (P = 1) if the temperature is high (A = 1) OR the humidity is high (B = 1), AND the manual override switch is NOT pressed (C = 0).

Draw a logic gate circuit to represent the Boolean expression: P = (A OR B) AND (NOT C)

A
B
C
P
[4]

(b) Complete the truth table for the logic circuit.

ABC(A OR B)(NOT C)P
000
001
010
011
100
101
110
111
[6]
Turn over
6
7

(a) The system receives data from a temperature sensor. A valid temperature reading is between 0 and 100 degrees inclusive.

Complete the test plan table with one example of test data for each category, and state the reason for choosing that data.

Test CategoryTest Data ExampleReason for Test
Normal Data
Valid Boundary Data
Invalid Data
[6]

(b) Explain why it is essential to test the sensor software with Invalid data during development.

[4]
8

A technician must authenticate to override the alarm. The correct passcode is "ECO2026".

Write an algorithm that:

[10]
Turn over
7
9

A trace table is used to test the power-saving algorithm for a remote sensor.

batteryLevel = 100 powerSave = False hours = 0 while batteryLevel > 20 if hours MOD 2 == 0 then batteryLevel = batteryLevel - 10 else batteryLevel = batteryLevel - 30 endif hours = hours + 1 if batteryLevel <= 40 then powerSave = True endif endwhile print(hours)

Complete the trace table for this algorithm.

batteryLevelpowerSavehoursOutput
100False0
[10]

*Note: Section B total is 40 marks: Q6(10) + Q7(10) + Q8(10) + Q9(10)*

END OF QUESTION PAPER