














































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















































Time allowed: 1 hour 30 minutes Do not use:
Oxford Cambridge and RSA INSTRUCTIONS
© OCR 2025 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 test data Normal test data Boundary test data Invalid / erroneous 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^ Turn^ over Start INPUT x OUTPUT "OK" x = x - 2 FALSE IS x < 0? TRUE End 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 ....................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... [4]
© OCR 2025^ Turn^ over
(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 [4]
© OCR 2025 (b) Tick (✓) one box in each table to complete the descriptions. An insertion sort… Tick (✓) one box uses an array of numbers with a sorted part and unsorted part picks out the middle value to begin with merges arrays of numbers together A bubble sort compares pairs of values and then: Tick (✓) one box always swaps them swaps them if they are in the correct order swaps them if they are in the incorrect order A sorting algorithm can sort data in an array. An array: Tick (✓) one box is declared with a fixed length stores multiple values that cannot be changed while the program is running can only be declared with a maximum of one-dimension (1D) [3] (c) An algorithm can be used to search for a value in an array. The algorithm follows these steps:
© OCR 2025 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 2025^ Turn^ over (c) Computational thinking techniques were used to design the security system. Draw one line to match each computational thinking technique to its correct example. Computational thinking technique Example [3] The step-by-step process for users to securely pay online is designed. Algorithmic thinking The user’s identity, PIN and password are required. All other data is ignored. Decomposition There is an increase in the amount of RAM in the computer running the system Abstraction The system is broken down into modules for security and payments.
© OCR 2025^ Turn^ over 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:
© OCR 2025 (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 2025 (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 [4]
© OCR 2025^ Turn^ over (ii) The array actNumbers is changed to include data for two more stages. The new array is shown: Index 0 1 2 3 4 Data actNumbers The algorithm from part (i) needs refining to work for the new array. The algorithm is repeated here: 01 count = 0 02 for x = 0 to 2 03 count = count + actNumbers[x] 04 next x 05 print(count) Identify the line number that will need to be changed for the new array and write the updated line of code. Line number ..................................................................................................................................... Updated code ................................................................................................................................... .......................................................................................................................................................... [2] (iii) Refine line 05 in the algorithm to output "The total act count is " and then the content of the variable count For example: The total act count is 50 New line 05 ......................................................................................................................................
. ................................................................................................................................................. [1]
© OCR 2025
If you need extra space use these lined pages. You must write the question numbers clearly in the margin. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. .................................................................................................................................................................. ..................................................................................................................................................................
© OCR 2025