






























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 AS Level Computer Science H046/02 Algorithms and problem solving Includes Verified Question paper & Marking Scheme Attached Oxford Cambridge and RSA Monday 19 May 2025 – Afternoon AS Level Computer Science H046/02 Algorithms and problem solving Time allowed: 1 hour 15 minutes Do not use: • a calculator Please write clearly in black ink. Do not write in the barcodes. 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 page 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 70. • 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 16 pages. ADVICE • Read each question carefully before you start your answer
Typology: Exams
1 / 38
This page cannot be seen from the preview
Don't miss anything!































Oxford Cambridge and RSA
Time allowed: 1 hour 15 minutes Do not use:
1 A gym owner would like a program for members to be able to book gym classes. Each class can have a maximum of 20 members. Members will enter their membership ID and then the date and time of the class they want to attend. Validation rules will check these details meet set rules. If they do not meet the validation rules then an error message will be displayed. A confirmation message will be displayed if the class is not full. A bleeping sound will play if the class is full. (a) Identify two inputs and two outputs for the program. Input 1 .............................................................................................................................................. Input 2 .............................................................................................................................................. Output 1 ........................................................................................................................................... Output 2 ........................................................................................................................................... [4] (b) The programmer is identifying any possible reusable components in the program design. Explain why the programmer should create reusable program components. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..................................................................................................................................................................... [3] © OCR 2025
2 Players in a computer game collect items. Each item has a name, e.g. “Fruit” and a type, e.g. “Apple”. The items for player 1 are stored in a 2D array. The array is 0-indexed. The pseudocode declaration for the array is: array p1Items[10,2] The first dimension stores the item name and the second dimension stores the type. (a) One characteristic of the array is that it has 2 dimensions. Identify two other characteristics of the given array. 1 ....................................................................................................................................................... .......................................................................................................................................................... 2 ....................................................................................................................................................... .......................................................................................................................................................... [2] (b) When the game starts, the pseudocode procedure initialiseArraywill initialise each name and type in the array to "empty". 1 procedure initialiseArray(p1Items:byRef) 2 counter = 0 3 while counter < 10 04 p1Items[counter, 0] = "empty" 05 p1Items[counter, 1] = "empty" 06 counter = counter + 1 7 endwhile 8 endprocedure (i) State why emptyis in speech marks on lines 04and 05. .......................................................................................................................................................... ..................................................................................................................................................................... [1] (ii) Rewrite the code in lines 02to 07to use a for loop instead of a while loop. Write your answer using pseudocode or program code. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... © OCR 2025
© OCR 2025 Turn over
3 A student has written this algorithm in pseudocode: for x = 1 to 4 item = data[x] y = x - 1 while (y >= 0) and (item < data[y]) data[y + 1] = data[y] y = y - 1 endwhile data[y + 1] = item next x Test the algorithm by completing the trace table. The array data is a 1-dimensional array with 5 positions initialised with the data shown in the trace table. You should continue your answer on the next page if you need more space. data x item y 0 1 2 3 4 10 2 5 20 19 [6] © OCR 2025
4* A group of four students have decided to create a computer program to help teach younger children how to write programs in a text-based language. (a) They intend to divide the program into sub programs that they will develop individually before combining them together to form the final solution. The students are considering the agile methodologies or the waterfall lifecycle. Compare the use of the agile methodologies and waterfall lifecycle for the students’ project. You should include the following in your answer:
(b) The students intend to use both black-box testing and white-box testing. Give one difference between black-box testing and white-box testing. .......................................................................................................................................................... .......................................................................................................................................................... .................................................................................................................................................. [1] © OCR 2025 Turn over
(d) The programmer needs to extend the program. The program will use a linear search. (i) The linear search has been written as a pseudocode function that:
6 Two data structures are a queue and a stack. (a) Describe one difference between a queue and a stack. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .................................................................................................................................................. [2] (b) The current contents of a stack created from an array called stack and pointer called topPointer are shown: index 7 6 5 4 3 2 1 0 stack 13 21 10 The topPointer currently stores 2. (i) State the purpose of topPointer in the stack. .......................................................................................................................................................... .................................................................................................................................................. [1] © OCR 2025
7 Write an algorithm, using program code or pseudocode to:
8 Show each pass of a bubble sort to sort the following string data into descending order. friend sun earth orange night time .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .................................................................................................................................................. [4] END OF QUESTION PAPER © OCR 2025
GCE Computer Science H046/02: Algorithms and problem solving AS Level Mark Scheme for June 2025 Oxford Cambridge and RSA Examinations
OCR (Oxford Cambridge and RSA) is a leading UK awarding body, providing a wide range of qualifications to meet the needs of candidates of all ages and abilities. OCR qualifications include AS/A Levels, Diplomas, GCSEs, Cambridge Nationals, Cambridge Technicals, Functional Skills, Key Skills, Entry Level qualifications, NVQs and vocational qualifications in areas such as IT, business, languages, teaching/training, administration and secretarial skills. It is also responsible for developing new specifications to meet national requirements and the needs of students and teachers. OCR is a not-for-profit organisation; any surplus made is invested back into the establishment to help towards the development of qualifications and support, which keep pace with the changing needs of today’s society. This mark scheme is published as an aid to teachers and students, to indicate the requirements of the examination. It shows the basis on which marks were awarded by examiners. It does not indicate the details of the discussions which took place at an examiners’ meeting before marking commenced. All examiners are instructed that alternative correct answers and unexpected approaches in candidates’ scripts must be given marks that fairly reflect the relevant knowledge and skills demonstrated. Mark schemes should be read in conjunction with the published question papers and the report on the examination. © OCR 2025 Oxford Cambridge and RSA Examinations