0% found this document useful (0 votes)
10 views14 pages

OCR Predicted Paper 2 2025

This document is a predicted paper for the OCR GCSE (9–1) Computer Science exam, specifically focusing on computational thinking, algorithms, and programming. It includes instructions, sections for various types of questions, and specific tasks related to programming concepts, algorithms, and data structures. The total mark for the paper is 80, and it is designed to assess students' understanding of computer science principles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views14 pages

OCR Predicted Paper 2 2025

This document is a predicted paper for the OCR GCSE (9–1) Computer Science exam, specifically focusing on computational thinking, algorithms, and programming. It includes instructions, sections for various types of questions, and specific tasks related to programming concepts, algorithms, and data structures. The total mark for the paper is 80, and it is designed to assess students' understanding of computer science principles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

gcsecomputersciencetutor.

com
OCR 2025 Predicted Paper 2
GCSE (9–1) Computer Science
J277/02 Computational thinking, algorithms and programming
Time allowed: 1 hour 30 minutes

Do not use a calculator

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

A Book a new fitness class


B View booked classes on screen
C Update health and fitness profile
D Access nutrition advice
E Log in to the system
F Download a PDF schedule

[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]

(d) The developer declares the following variables.

username = "SuperFit_Member11"
status = "Active_True”

State the output from the following lines of program code.

(i) print(status.substring(5,5)) _____________________________________[1]

(ii) print(int(username.right(2))*2 MOD status.length) ____________________[1]

gcsecomputersciencetutor.com
gcsecomputersciencetutor.com
2. (a) Compute the following truth table

A B C A AND B NOT C P = (A AND B) OR (NOT C)

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

(a) State the name of the programming construct used twice.

_________________________________________________________________[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

(a) Show each stage of an insertion sort on the contents above.

____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[4]

(b) Give two advantages of using an insertion sort.

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

(a) Complete the trace table below when foo(4) is called.

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]

(d) A math app contains the following procedures:

A. calculateSingleArea() B. calculateAreas(n) C. showFormula()

Write program code using a SWITCH statement which:


• asks the user to input a letter and runs the matching procedure based on
their input, eg, an input of “A” runs the calculateSingleArea procedure
• displays a message if the input does not match any option

____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[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

In this table, the value of sides[1,1] contains 6

Each pair belongs to a single student (i.e. the first row are Student 1's trapezium,
next one are Student 2's, etc.).

Write a procedure that:


• Calculates the area for each trapezium using the formula area = 0.5 × (a + b) × 5
• Outputs each student’s number and their total area eg, Student 1’s area is 30

You must use either:


• OCR Exam Reference Language, or
• A high-level programming language you have studied.

____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[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

Data Type Tick one box

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 = _____________

while low <= high


mid = _______________
if students[mid] == studentName then
return True
else if studentName < students[mid] then
high = ____________
else
low = ____________
endif
endwhile

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.

StudentID Name Date Minutes

1001 Ayaan Khan 2025-04-10 90

1002 Sarah 2025-04-10 135


Ahmed
1003 James Lee 2025-04-11 53

1004 Emma 2025-04-11 140


Jones
1005 Lucas Patel 2025-04-12 89

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.

01 number = input("Please enter your mark")


02 total = 80
03 percentage = number / total * 100
04 if (percentage >= 70 AND percentage <= 100) then
05 print("You have achieved a grade A")
06 elseif (percentage >= 50 AND percentage < 70) then
07 print("You have achieved a grade B")
08 elseif (percentage >= 30 AND percentage < 50) then
09 print("You have achieved a grade C")
10 else
11 print("You have failed")
12 endif

The program needs to be tested.


Complete the test plan below to test for potential issues of the program

Test Type Test Reason for testing Actual Outcome


Data
60 “You have achieved a
grade B”

99 To ensure the program


can handle inputs of the
correct data type that
should be rejected
Boundary

[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.

The program must:


• use a WHILE loop to read each value from homework.txt
• store each value in an array called homeworkTimes
• generate a random student ID (between 1000 and 9999) for each time read
and store it in a second array called studentIDs

Write program code to perform this task.

You must use either:


• OCR Exam Reference Language, or
• A high-level programming language that you have studied.

____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
[6]

END OF PAPER

gcsecomputersciencetutor.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy