



































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
2025 OCR GCSE (9–1) Computer Science J277/02 Computational thinking, algorithms and programming Time allowed: 1 hour 30 minutes (Verified Question Paper With Mark Scheme Combined June 2025) 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. OCR 2025 [601/8355/X] DC (WW/JG) 355817/3 OCR is an exempt Charity Turn over Section A We advise you to spend approximately 50 minutes on Section A.
Typology: Exams
1 / 75
This page cannot be seen from the preview
Don't miss anything!




































































Oxford Cambridge and RSA - 2025
Time allowed: 1 hour 30 minutes
© OCR Turn over 2 This flowchart uses iteration. (a) Complete the table by identifying how many times "OK" will be output for when each value is input. Input value Number of times "OK" is output 3 10 [2] (b) Iteration is a programming construct. (i) Identify and describe two different examples of iteration that can be used in a high-level language. 1 .......................................................................................................................................... ............. ............................................................................................................................................ .............. ............................................................................................................................................ .............. 2 .......................................................................................................................................... End
IS x < 0?
x = x - 2
INPUT x Start
© OCR
© OCR Turn over
(a) Show the steps that a merge sort would take to put the data set into ascending numerical order.
© OCR
© OCR 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 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:
© OCR Turn over (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:
© OCR
© OCR
© OCR Turn over (b) The database table TblMusic stores data about the music acts. Some of the data in TblMusic is shown: ActID Stage Day SetLength 1 Platinum Saturday 0. 2 Hills Saturday 1. 3 Triangle Sunday 1. 4 Platinum Sunday 0. An SQL statement has been written to show ActID and Stage for all acts playing on Saturday. The SQL statement is incorrect. SELECT ActID AND Stage FROM TblActs IF Day = Saturday (i) Refine the SQL statement to correct the errors. ............................................................................................................................................ .............. ............................................................................................................................................ .............. ............................................................................................................................................ .............. .................................................................................................................................. [4] (ii) Identify one example of a record from TblMusic ............................................................................................................................................ .............. .................................................................................................................................. [1] (iii) Give the most appropriate data type for each field shown. Field name Data stored Data type Stage (^) The name of the stage SetLength (^) The length of each set in hours [2]
© OCR Turn over
© OCR (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 actNumbers This algorithm adds up the total number of acts on all three stages. 01 count = 0 02 for x = 0 to 2 03 count = count + actNumbers[x] 04 next x 05 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