Question Paper Practice 2023 (J27702)
Question Paper Practice 2023 (J27702)
Do not use:
• a calculator
First name(s)
Last name
INSTRUCTIONS
• Use black ink.
• 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 [ ].
• This document has 24 pages.
ADVICE
• Read each question carefully before you start to answer.
• We advise you to spend approximately 50 minutes on Section A and approximately 40
minutes on Section B.
2 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
SECTION A
We advise you to spend approximately 50 minutes on Section A.
1 Tick (✓) one box in each row to identify if each operator is a comparison operator or an
arithmetic operator.
[4]
(a) temp = 7
print(temp)
endif
……..……..…………………………………….…………………………………………….………….. [1]
(b) value = 3
value = value - 1
print(value * 2)
……...…………………………………………………..…………………………………….………….. [1]
number = scores[2]
print(number)
……..……………………………………..….……………………………………………….………….. [1]
Turn over
3 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
x = day.length
print(x)
……..…….….………………..………………………………………….………………….……….….. [1]
3 An array stores a collection of words. The array has the identifier data.
A searching algorithm is used to find a word in the array data. The algorithm used to search for
a word is shown.
….…..…………………………………………………………………………………….……………… [1]
4 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………………………………………………………………………...…………………..
...….……………………..………………………..…..………………………………………...………. [4]
Turn over
5 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(c) An insertion sort is used to put the array with the identifier data into alphabetical order.
The diagram shows the array when the insertion sort is almost complete.
Section A Section B
.......…..….……………….….……………………………………………………………………………….
.…...……......………….…………………………………………………………………………..…………
........…..….….………….……………………………………………………………………………………
..……........….…………….…………………………………………………………………………..…. [2]
(ii) Describe the steps an insertion sort takes to complete sorting the array data.
………………….…….…………….….………………………………………………………………..……
………………….…….…………….….………………………………………………………………..……
………………….…….…………….….………………………………………………………………..……
………………….…….…………….….………………………………………………………………..……
………………….…….…………….….………………………………………………………………..……
…………………….….………………….……………………….…………………………………..….. [3]
(d) One sorting algorithm splits an array into single items and then combines them into an ordered
array.
………………………………………………….………………………….……..…………………..…. [1]
6 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
4 Complete the description of computational thinking using the given list of terms.
Computational thinking is the process of analysing problems so that they can be solved in a
logical way.
manageable parts.
Algorithmic …………………………………. identifies the main steps needed to solve the problem
[4]
Turn over
7 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(a) Describe two advantages to the programmer of using a high-level language instead of a
low-level language.
1 ...………………………….…………………………………………………………………...…………..
…………………….…..……………………………………………………………………………………..
………………………...……………………………………………………………………………………..
………………………...……………………………………………………………………………………..
2 ………………………...………………………………………….……………...………………………..
………………………...……………………………………………………………………………………..
…….…..……………………………………………………………………………………………………..
…….…….……………………………………………………………………………………..……..…. [4]
Tick (✓) one box in each row to identify whether each statement describes the use of a
compiler, an interpreter, or both.
8 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
An action P is carried out if the player presses A with either B or C at the same time.
B P
[3]
A B C P
0 0 0
0 0 1
0 1 0
0 1 1
0 0
0 1
1 0
1 1
[3]
Turn over
9 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(c) In the computer game, a player collects items. Each item has a score. The score for each
item is stored using the data type real.
……………………………………..…………………………………………………………………….. [1]
(d) The result of the game can be a win, a loss or a draw. The result is stored in a variable with
the identifier result.
(i) State why result cannot be stored using a Boolean data type.
...……………………………….………………………………………………………...…………………..
…..……..………………………….…………………………………………………………..………… [1]
(ii) Give a suitable data type for result. Explain your answer, showing how each result
could be stored.
Explanation ……………………..…………………………………………………….………………..…..
……………………………………………………………………………………..…………….…………..
…………………………………….…………………………………………………………...………... [2]
10 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(e) A player enters a code at the beginning of the game. The code is three characters long.
The code sets the level of the game. The game has three levels.
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
..………………………………………………………..……………………..…………………………. [6]
Turn over
11 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
...…………………………………………………………………………………………..…….………...…
…………………………………………………………………………………………………………… [3]
(iii) Complete the line of code to output the value returned from the function nextlevel()
when the integer value 3 is passed in as a parameter.
print(…………………….……………..….……..…..(…………………….…....……………..….))
[1]
12 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
SECTION B
We advise you to spend approximately 40 minutes on Section B.
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.
(a) Details about the drones that pilots fly are stored in a database table called TblDrone.
Some of the data stored in this table is shown.
TblDrone
(i) Complete the SQL statement to display DroneID and Mileage for all Octocopter type
drones that have a mileage of greater than 50 000 miles.
SELECT ……………………………
…………………………… TblDrone
Turn over
13 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(ii) Drones must be checked every 10 000 miles. If the difference between Mileage and
LastCheck is greater than 10 000 then the drone needs to be checked.
A flowchart shows the steps needed to check a drone.
The flowchart outputs "Check" if the drone needs to be checked.
The flowchart outputs "No Check" if the drone does not need to be checked.
Start
if
False
………….……………………….
…………………… Output
……………………
………….………………………. ………….……….…….
……………………
True
Output
…………..…………….
End
[2]
14 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(b) A pilot code is automatically generated when a new pilot joins the company.
You may not need to use all rows in the trace table.
01 H
02 K
03 9
[4]
Turn over
15 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(c) A pilot's flying experience is validated. An algorithm checks that the experience is between 0 and
20 years.
print(True)
else
print(False)
endif
Normal True
20 Boundary
32
[4]
16 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(d) Pilots are paid a set amount each day. Pilots also get an additional payment for each
mile they have flown that day. These payments are shown in the table.
For example, a pilot with 3 years’ experience who flies 100 miles in one day will receive a total of
£215.00 pay. This is calculated in the following way:
• Calculate the total pay for the pilot for that day
totalPay = 0
…………….………………………………………………………………………………………….……....
…………….………………………………………………………………………………………….……....
…………….………………………………………………………………………………………….……....
…………….…………………………………………………………………………………………….…....
…………….………………………………………………………………………………………….……....
…………….…………………………………………………………………………………….…………....
…………….………………………………………………………………………………….………….…...
…………….……………………………………………………………………………………..…………...
print(totalPay)
[4]
Turn over
17 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(ii) The programmer decides to make a function to calculate the total pay for the pilot.
The function is called calculatePay().
The function takes the values for experience and miles as two parameters and returns the
total pay for the pilot.
Refine the algorithm to use this function and output the pay for the pilot.
print( totalPay )
[2]
18 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(e) A text file is used to store pilot’s codes and date of birth.
The text file is named pilots.txt . The contents of some of this file is shown:
JP670,17/05/1986
CC200,31/06/1980
SM720,01/04/1976
GC730,06/06/1978
……………………………………………………………………………………….……………….……..
…………………………………………………………………………………………….………….……..
…………………………………………………………………………………………….…………….…..
…………………………………………………………………………………………….………………...
……………………………………………………………………………………………….……………...
……………………………………………………………………………………………….………….…..
……………………………………………………………………………………………….………….…..
………………………………………………………………………………………………….……….…..
………………………………………………………………………………………………….……….…..
…………………………………………………………………………………………………….………...
……………………………………………………………………………………………………….….…..
…………………………………………………………………………………………………….…….…..
……………………………………………………………………………………………………….……...
………………………………………………………………………………………………………..… [4]
Turn over
19 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
(f) A pilot is allowed to fly a maximum of 9 hours per day. The pilot code and the hours flown for
each flight in one day are stored in a 2D array of strings with the identifier journeys.
The data in journeys is shown.
[0] [1]
[0] "SM720" "4.5"
[1] "GC730" "3"
[2] "JP670" "2"
[3] "GC730" "3.5"
[4] "CC200" "9"
[5] "RY320" "12"
………………………………………………………………………………………...……………………..
………………………………………………………………………………………………...……………..
………………………………………………………………………………………………………...……..
…………………………………………………………………………………………………………….....
…………………………………………………………………………………………………………...…..
…………………………………………………………………………………………………………….....
…………………………………………………………………………………………………………...…..
………………………………………………………………………………………………...……………..
……………………………………………………………………………………………………...………..
…………………………………………………………………………………………………...…………..
……………………………………………………………………………………………...………………..
………………………………………………………………………………………...……………………..
………………………………………………………………………………………………...……………..
20 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
………………………………………………………………………………………………………...……..
…………………………………………………………………………………………………………….....
…………………………………………………………………………………………………………...…..
…………………………………………………………………………………………………………….....
…………………………………………………………………………………………………………...…..
………………………………………………………………………………………………...……………..
……………………………………………………………………………………………………...………..
…………………………………………………………………………………………………...…………..
……………………………………………………………………………………………...………………..
……………………………………………………………………………………………...………………..
……………………………………………………………………………………………..……….…… [6]
Turn over
21 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
22 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
Copyright Information:
OCR is committed to seeking permission to reproduce all third-party content that it uses in the assessment materials. OCR has attempted to
identify and contact all copyright holders whose work is used in this paper. To avoid the issue of disclosure of answer-related information to
candidates, all copyright acknowledgements are reproduced in the OCR Copyright Acknowledgements booklet. This is produced for each
series of examinations and is freely available to download from our public website (www.ocr.org.uk) after the live examination series.
If OCR has unwittingly failed to correctly acknowledge or clear any third-party content in this assessment material, OCR will be happy to
correct its mistake at the earliest possible opportunity.
For queries or further information please contact the Copyright Team, The Triangle, Shaftesbury Road, Cambridge, CB2 8EA.
OCR is part of the Cambridge Assessment Group; Cambridge Assessment is the brand name of University of Cambridge Local
Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge
23 © OCR 2023
GCSE (9-1) Computer Science J277/02 Practice paper
Please note – web links are correct at date of publication but other websites may
change over time. If you have any problems with a link you may want to navigate
to that organisation’s website for a direct search.
We’d like to know your view on the resources we produce. Click ‘Like’ or ‘Dislike’ to send us an auto generated email about this
resource. Add comments if you want to. Let us know how we can improve this resource or what else you need. Your email will not be
used or shared for any marketing purposes.
Looking for another resource? There is now a quick and easy search tool to help find free resources for your qualification.
OCR is part of Cambridge University Press & Assessment, which is itself a department of the University of Cambridge.
For staff training purposes and as part of our quality assurance programme your call may be recorded or monitored.
Oxford Cambridge and RSA Examinations is a Company Limited by Guarantee. Registered in England. Registered office
The Triangle Building, Shaftesbury Road, Cambridge, CB2 8EA. Registered company number 3484466. OCR is an exempt charity.
OCR operates academic and vocational qualifications regulated by Ofqual, Qualifications Wales and CCEA as listed
in their qualifications registers including A Levels, GCSEs, Cambridge Technicals and Cambridge Nationals.
OCR provides resources to help you deliver our qualifications. These resources do not represent any particular teaching method we
expect you to use. We update our resources regularly and aim to make sure content is accurate but please check the OCR website so
that you have the most up to date version. OCR cannot be held responsible for any errors or omissions in these resources.
Though we make every effort to check our resources, there may be contradictions between published support and the specification, so
it is important that you always use information in the latest specification. We indicate any specification changes within the document
itself, change the version number and provide a summary of the changes. If you do notice a discrepancy between the specification and
a resource, please contact us.
© OCR 2023 - You can copy and distribute this resource freely if you keep the OCR logo and this small print intact and you
acknowledge OCR as the originator of the resource.
OCR acknowledges the use of the following content: N/A
Whether you already offer OCR qualifications, are new to OCR or are thinking about switching, you can request more information
using our Expression of Interest form.
Please get in touch if you want to discuss the accessibility of resources we offer to support you in delivering our qualifications.
24 © OCR 2023