OCR Predicted Paper 2 2025
OCR Predicted Paper 2 2025
com
OCR 2025 Predicted Paper 2
GCSE (9–1) Computer Science
J277/02 Computational thinking, algorithms and programming
Time allowed: 1 hour 30 minutes
INSTRUCTIONS
• Use black ink. You can use an HB pencil, but only for graphs and
diagrams.
• Write your answer to each question in the space provided. If you need
extra space, use the lined pages at the end of this booklet. The question
numbers must be clearly shown.
• Answer all the questions.
INFORMATION
• The total mark for this paper is 80.
• The marks for each question are shown in brackets [].
• Quality of extended response will be assessed in questions marked with
an asterisk (*).
• This document has 14 pages.
ADVICE
• Read each question carefully before you start your answer.
• This is just a predicted paper based off previous years
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
SECTION A
We advise you to spend approximately 60 minutes on Section A
1. (a) A gym uses a mobile phone app to allow members to manage their membership.
Members must log in before they can access the system. They then choose to book a
new fitness class, view their booked classes, or update their health and fitness profile. If
they choose to view booked classes, they can either see them on the screen or
download a PDF schedule.
A structure diagram has been used to design the mobile phone app. Write one letter
from the following table in each space to complete the structure diagram.
Letter Task
[4]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
(b) When a member books a new fitness class using the app, they must select the class
and confirm the booking.
Identify one input, one process, and one output in this scenario.
Input _________________________________________________________________
Process________________________________________________________________
Output________________________________________________________________
[3]
(c) A developer is designing the gym's mobile phone app to allow users to manage their
fitness classes and profile.
(i) Explain how the principle of abstraction could be applied when designing the
mobile phone app.
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[2]
(ii) The developer wants to write an algorithm to handle class bookings.
Explain how algorithmic thinking will help the developer solve this problem.
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[2]
username = "SuperFit_Member11"
status = "Active_True”
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
2. (a) Compute the following truth table
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
[2]
(b) Complete the following logic diagram for P = (A AND B) OR NOT C by drawing one
logic gate in each box.
[3]
(c) Describe the purpose of a truth table.
____________________________________________________________________
____________________________________________________________________
[2]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
3. A procedure takes as input a number between 1 and 100 (inclusive). It calculates and
outputs the square of each number starting from 1, to the number input. The square of
a number is the result of multiplying a number itself.
01 procedure squares()
02 do
03 number = input(“Enter a number between 1 and 100”)
04 until number > 1 AND number < 100
05 for x = 1 to number:
06 print(x * 2)
07 next x
08 endprocedure
_________________________________________________________________[1]
(b) Two types of errors in a program are syntax and logic errors.
Identify two logic errors in the pseudocode algorithm.
Error 1 line number____________________________________________________
Corrected line________________________________________________________
____________________________________________________________________
Error 2 line number____________________________________________________
Corrected line________________________________________________________
____________________________________________________________________
[4]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
4. Jake would like to use a bubble sort to sort 250 000 numbers into order from lowest to
highest.
Currently the first 5 numbers before they have been sorted are:
195 584 167 147 158 187 160 125 184 236
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[4]
1.__________________________________________________________________
____________________________________________________________________
2.__________________________________________________________________
____________________________________________________________________
[2]
(c) Describe two features that are commonly found in IDEs that will help Jake write his
program code.
1 __________________________________________________________________
____________________________________________________________________
____________________________________________________________________
2 __________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[4]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
5. Programs can be written in high-level languages or low-level languages
(a) Give two reasons why some programs are written in a high-level language
1 __________________________________________________________________
____________________________________________________________________
2 __________________________________________________________________
____________________________________________________________________
[2]
(b) Describe the drawbacks of using an interpreter writing a program.
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[2]
6. The formula for calculating the area of a trapezium is 0.5(a + b)h. A programmer writes a
procedure called foo which takes a parameter n and outputs the area of n trapeziums.
The sides a and b start at 1 and increase by 1 each time. The height h stays at 5.
01 procedure foo(n)
02 for i = 1 to n
03 a=i
04 b=i+1
05 t = 0.5 * (a + b) * 5
06 print(t)
07 next i
08 endprocedure
i a b t
1
2
3
4
[2]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
(b) Describe two ways to improve the maintainability of the algorithm.
1 __________________________________________________________________
____________________________________________________________________
2 __________________________________________________________________
[2]
(c) A student defines a local variable in the foo procedure. He later tries to reuse the
variable outside of the procedure. Explain what will happen.
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[2]
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[4]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
(e) A class of students have each been given one trapezium to calculate the area for.
The program stores the values of a and b for each trapezium in a 2D array called
sides, where each row represents a trapezium and contains two values: a and b.
A B
3 4
5 6
2 3
1 2
Each pair belongs to a single student (i.e. the first row are Student 1's trapezium,
next one are Student 2's, etc.).
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[6]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
SECTION B
We advise you to spend at least 30 minutes on this section.
Some questions require you to respond using either the OCR Exam Reference Language or a
high-level programming language you have studied. These are clearly shown.
7. A teacher researches the length of time students spend playing computer games each
day.
(a) Tick one box to identify the data type you would choose to store the data and
explain
String
Integer
Real
Boolean
Justification:__________________________________________________________
____________________________________________________________________
[2]
(b) Explain the difference between the = operator and the == operator.
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[2]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
(c) The student names in the class are stored in a sorted array called students. An
example of the data in this array is shown:
Index 0 1 2 3 4 5
Data "Ali" "Ben" "Farah" "James" "Ravi" "Zara"
A binary search function is used to find whether a student is in the class. The
function:
• takes a student name as a parameter
• returns True if the student name is in the array
• returns False if the student name is not in the array
function BinarySearch(studentName)
low = 0
high = _____________
return False
endfunction
[4]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
(d) Describe the difference between a for loop and a while loop.
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[4]
(e) The data of how much time students spend playing computer games each day is
stored in a database table called GameLog.
Write an SQL query to display the names and dates of students who:
- played games for more than 100 minutes
- on 10th April 2025 and 11th April 2025 but not on 12th April 2025
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[4]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
(f) The teacher uses a program to assign a grade to students based on their percentage
score in a test.
[3]
gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
(g) A teacher is developing a program to help analyse how long students spend on
homework each evening. The data is stored in a text file called homework.txt.
The file contains a single number on each line, representing the number of minutes
spent by different students. A program written in a high-level language is used to
access the data from the text file.
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[6]
END OF PAPER
gcsecomputersciencetutor.com