2O25 0CR GCSE Computer Science J277/02 Computational thinking, algorithms and programming, Exams of Computer science

2O25 0CR GCSE Computer Science J277/02 Computational thinking, algorithms and programming Question Paper and Marking Scheme Attached 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 20 pages. ADVICE • Read each question carefully before you start your answer. • We advise you to spend approximately 50 minutes on Section A and approximately 40 minutes on Section B.

Typology: Exams

2025/2026

Available from 12/09/2025

bethwel-mayas
bethwel-mayas 🇺🇸

104 documents

1 / 52

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
OCR GCSE COMPUTER SCIENCE
2O25 0CR GCSE Computer Science J277/02 Computational
thinking, algorithms and programming
Question Paper and Marking Scheme Attached
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 20 pages.
ADVICE
Read each question carefully before you start your answer.
We advise you to spend approximately 50 minutes on Section A and approximately 40 minutes on
Section B.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34

Partial preview of the text

Download 2O25 0CR GCSE Computer Science J277/02 Computational thinking, algorithms and programming and more Exams Computer science in PDF only on Docsity!

OCR GCSE COMPUTER SCIENCE

2O25 0CR GCSE Computer Science J277/02 Computational

thinking, algorithms and programming

Question Paper and Marking Scheme Attached

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 20 pages. ADVICE
  • Read each question carefully before you start your answer.
  • We advise you to spend approximately 50 minutes on Section A and approximately 40 minutes on Section B.

Section A We advise you to spend approximately 50 minutes on Section A. 1 A program asks a user to enter a number. Only integer values between 1 and 100 (inclusive) are accepted. The program is tested. (a) Tick (✓) one or more boxes in each row to identify the type or types of test for each example of test data. Example Normal Boundary Invalid / erroneous test data test data test data test data 27 "Hello" 105 100 [4] (b) An algorithm is written for the program. (i) Complete the algorithm for the program. num = input("Enter a number between 1 and 100") if num ........................................ AND ........................................ then print("accepted") ........................................ print("not accepted") endif [3] (ii) Give the identifier of one variable used in the algorithm in part (b)(i). ..................................................................................................................................................... [1] (iii) Give one Boolean operator used in the algorithm in part (b)(i). ..................................................................................................................................................... [1] © OCR 2025

(ii) Give the names of two other programming constructs that are used in a high-level language. 1 ....................................................................................................................................................... 2 ....................................................................................................................................................... [2] (c) A programmer implements the flowchart as a program in a high-level language using an Integrated Development Environment (IDE). Identify and describe two tools that the programmer could use in the IDE to create a program from the flowchart. Tool 1 ................................................................................................................................................ Description ....................................................................................................................................... .......................................................................................................................................................... Tool 2 ................................................................................................................................................ Description ....................................................................................................................................... .......................................................................................................................................................... [4] © OCR 2025

(a) Show the steps that a merge sort would take to put the data set into ascending numerical order. 2,7,3,1,9,6,5, [4] © OCR 2025 Turn over

4 An algorithm is written to read numbers from the external text file data.txt Each number is checked when it is read from the external text file. The number is output to the user if it is not 0. (a) Complete the algorithm using the OCR Exam Reference Language statements in the box. Not all statements are used. data for if myFile.close() myFile.readLine() input() myFile.writeLine() open print temp txt x myFile = ................................................................. ("data.txt") while NOT myFile.endOfFile() temp = ................................................................. if int (.................................................................) != 0 .................................................................(temp) endif endwhile ................................................................. [5] (b) Identify how casting is used in this algorithm. .......................................................................................................................................................... ..................................................................................................................................................... [1] © OCR 2025 Turn over

5 A security system protects online credit card payments. The system has three inputs: Input Description A True when the user enters their correct password B True when the user enters their correct PIN C True when the card is blocked The output (P) is True if both of the following conditions are True:

  • the user has entered either their correct password or has entered their correct PIN
  • the card is not blocked. (a) Draw the logic circuit for the security system A B C (b) Complete the truth table for P = A AND B A B P

P

[3]

[2]

© OCR 2025

(d) As part of the security system, the user is asked to choose a 4-digit value for their PIN. This PIN cannot be 1234 or 4321 Create an algorithm that:

  • takes the PIN as input as a string
  • checks that the PIN is 4 characters in length
  • checks that the PIN is not either “1234” or “4321”
  • outputs "VALID PIN" if the PIN meets all of the criteria
  • outputs "INVALID PIN" if the PIN does not meet all of the criteria. You do not need to check that the digits entered are numeric. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..................................................................................................................................................... [6] © OCR 2025

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. 6 OCR Rockfest is a yearly music festival. Visitors buy tickets to attend and watch the music acts. A computer system is created to sell tickets and store information about visitors and the music acts. (a) Visitors are asked to choose a password. The password is entered twice and stored in the variables passA and passB (i) Tick (✓) one box to identify the correct OCR Exam Reference Language statements for the design of this task. OCR Exam Reference Language to enter two passwords Tick (✓) one box passA and passB = input("enter password twice") input("enter your password") = passA input("enter your password again") = passB passA = input("enter your password") passB = input("enter your password again") "passA" = input("enter your password") "passB" = input("enter your password again") [1] (ii) Design an algorithm that:

  • checks if the passwords stored in passA and passB are the same
  • outputs "passwords match" if they are the same
  • outputs "passwords do not match" if they are not the same. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..................................................................................................................................................... [3] © OCR 2025 Turn over

(c) Tickets to the festival are £60 each. Visitors can buy multiple tickets. For example, a visitor buying 4 tickets would pay £240. (i) Write a function, calculatePrice() that:

  • takes the number of tickets to be purchased as a parameter
  • calculates and returns the total price to pay. You must use either:
  • OCR Exam Reference Language, or
  • a high-level programming language that you have studied. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..................................................................................................................................................... [4] (ii) Write an algorithm that:
  • uses the function calculatePrice() to find the price for a visitor buying 3 tickets
  • stores the result in the variable totalPrice You must use either:
  • OCR Exam Reference Language, or
  • a high-level programming language that you have studied. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..................................................................................................................................................... [2] © OCR 2025 Turn over

(d) The number of different music acts on each of the three stages is stored in the array actNumbers. Each index of the array represents one stage. Index 0 1 2 Data (^10 14 ) actNumbers This algorithm adds up the total number of acts on all three stages. 01 count = 0 02 for x = 0 to 2 3 count = count + actNumbers[x] 4 next x 5 print(count) (i) Complete the trace table for the algorithm. You may not need to use all rows in the table. Line number count^ x^ Output [4] © OCR 2025

(e) There are 500 tickets available for the music festival. The number of tickets currently available is stored in the variable tickets Complete the algorithm to:

  • prompt the user to enter how many tickets they would like and take this value as input
  • output "Tickets booked" and reduce the value stored in tickets if there are enough tickets available
  • output "Not enough tickets" if there are not enough tickets available
  • repeat the steps until there are no tickets left. You must use either:
  • OCR Exam Reference Language, or
  • a high-level programming language that you have studied tickets = 500 .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..................................................................................................................................................... [6] END OF QUESTION PAPER © OCR 2025

EXTRA ANSWER SPACE

If you need extra space use these lined pages. You must write the question numbers clearly in the margin. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. © OCR 2025

© OCR 2025

Oxford Cambridge and RSA Copyright Information OCR is committed to seeking permission to reproduce all third-party content that it uses in its 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 OCR Copyright Team, The Triangle Building, Shaftesbury Road, Cambridge CB2 8EA. OCR is part of Cambridge University Press & Assessment, which is itself a department of the University of Cambridge. © OCR 2025