Exclusive Practice Resource

Monday 25 May 2026 - Afternoon

GCSE (9-1) Computer Science

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

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) Match the computational thinking terms to their definitions.

Term A: Abstraction  |  Term B: Decomposition  |  Term C: Algorithmic Thinking

1. The process of removes unnecessary detail to focus on key areas.

2. The process of creates a step-by-step logic to solve a task.

3. The process of breaks the problem down into sub-tasks.

[3]

(b) Explain why Abstraction is a necessary step when designing a computer model of a real-world hospital waiting room.

[3]
2

(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) State two features found in an Integrated Development Environment (IDE) that assist a programmer in writing code (excluding debugging tools).

1:

2:

[2]
Turn over
3
3

(a) Describe the difference between a Syntax Error and a Logic Error.

[4]

(b) Explain the difference between Iterative Testing and Terminal Testing during the software development lifecycle.

[4]
4

(a) A program uses the string variable hospitalName = "General Infirmary".

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

StatementOutput
print(hospitalName.left(7))
print(hospitalName.length)
print(hospitalName.substring(8, 9))
print(hospitalName.upper)
[4]

(b) Write a single line of OCR Reference Language to extract the word "mary" from the variable hospitalName and store it in a variable called endPart.

[2]
Turn over
4
5

(a) A database table Patients stores the PatientID, WardName, and PriorityLevel.

Write an SQL query to output the PatientID and WardName of all patients where the PriorityLevel is equal to 1.

SELECT FROM WHERE
[4]

(b) State what the * (asterisk) symbol represents when used in an SQL SELECT statement.

[2]
6

(a) Complete the table to justify the most appropriate data type for each variable.

VariableData TypeJustification
BedNumber (e.g. 14)
Temperature (e.g. 37.5)
Discharged (e.g. True)
[6]

(b) State the output of the following arithmetic operations:

23 MOD 5 =

23 DIV 5 =

[2]
Turn over
5

SECTION B

Context: Hospital Triage and Patient Management

7

(a) The hospital uses an Insertion Sort algorithm to organise patients by their arrival time.

Describe the step-by-step process of an Insertion Sort.

[4]

(b) If the list of patients is already almost entirely sorted in the correct order, explain why an Insertion Sort would be more efficient than a Bubble Sort.

[4]
8

A trace table is used to test the algorithm below, which calculates patient priority scores.

priority = 5 flag = True while flag == True for p = 1 to 3 priority = priority + p next p if priority > 10 then flag = False endif endwhile print(priority)

Complete the trace table for this algorithm.

priorityflagpOutput
5True
[10]
Turn over
6
9

(a) The hospital records the waiting time (in minutes) for 50 patients in a 1D array called triageTimes.

Write an algorithm using iteration that:

[8]

(b) Explain two reasons why it is more efficient for the programmer to store the 50 waiting times in an array rather than using 50 separate variables (e.g. time1, time2).

[4]
Turn over
7
10

(a) A programmer has written a flawed function to determine if a patient should be admitted.

01 function checkAdmit(severityScore) 02 severityScore = input("Enter severity score") 03 if severityScore > 8 then 04 print("Admit Patient") 05 else 06 print("Discharge") 07 endif 08 endfunction

Identify the line number of the logic error regarding parameter usage, and state how it should be corrected.

Line number of error:

Correction:

[4]

(b) Identify two ways the programmer can make the above code more maintainable, and explain why each helps.

Method 1:

Reason:

Method 2:

Reason:

[4]

(c) A subroutine is called using the following statement:

assignBed(patientID, wardName, requiresOxygen)

State how many parameters are being passed to this subroutine.

[2]
END OF QUESTION PAPER