OCR AS Level Computer Science H046/02 Algorithms and problem solving Question Paper and M, Exams of Computer Science

OCR AS Level Computer Science H046/02 Algorithms and problem solving Question Paper and Mark Scheme MAY 2025

Typology: Exams

2025/2026

Available from 11/25/2025

Favorgrades-1
Favorgrades-1 🇺🇸

5

(1)

18K documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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.
Centre number
Candidate number
First name(s)
Last name
OCR AS Level Computer Science H046/02 Algorithms and problem
solving Question Paper and Mark Scheme MAY 2025
Oxford Cambridge and RSA
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.
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

Partial preview of the text

Download OCR AS Level Computer Science H046/02 Algorithms and problem solving Question Paper and M and more Exams Computer Science in PDF only on Docsity!

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. Centre number Candidate number First name(s) Last name

OCR AS Level Computer Science H046/02 Algorithms and problem

solving Question Paper and Mark Scheme MAY 2025

Oxford Cambridge and RSA 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.

© OCR 2025 [601/5030/0] DC (KS) 324952/ OCR is an exempt Charity Turn over

(^9) (^8) (^8) (^2) (^5) (^9) (^5) (^3) (^0) (^3) (^) *

© OCR 2025 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^ Turn^ over

BLANK PAGE

DO NOT WRITE ON THIS PAGE

© OCR 2025^ Turn^ over (iii) State one reason why the array should be passed by reference and not by value. ..........................................................................................................................................................

. ................................................................................................................................................. [1] (c) When a user collects an item, the name and type are added to the array p1Items. At the end of the game, the name of each item collected is output. Write an algorithm, using pseudocode or program code, to:

  • output the name of each item in the array
  • output a suitable message if there are no items in the array. If the item is "empty" it should not be output. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... . ................................................................................................................................................. [6]

© OCR 2025 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

[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:

  • features of each software development methodology
  • benefits of each software development methodology in this scenario
  • drawbacks of each software development methodology in this scenario. [9] .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..........................................................................................................................................................

© OCR 2025^ Turn^ over

(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:

  • takes an array called array of an unknown length as a parameter
  • takes a search value called value to search for as a parameter
  • uses a linear search to find the value in the array
  • returns true if the value is found and false otherwise. Complete the pseudocode function. function linearSearch(array, ................. ) counter = 0 while counter .......... array.length if array[counter] == value then return ………………………… endif counter = counter ………………………… endwhile ………………………… ………………………… endfunction [5] (ii) One alternative search algorithm is a binary search. Describe the steps in a binary search. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... . ................................................................................................................................................. [4]

© OCR 2025 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 stack 7 6 5 4 3 2 1 0 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:

  • take a user’s date of birth as a string input in the format DD/MM/YYYY
  • take a year as input from the user in the format YYYY
  • output the age the user will be on their birthday in the year input in the format: You will be 18 on the 1 January 2029 You can use the function getMonth() to convert a 2 - digit month into a string. For example: getMonth(02) will return "February". You do not need to check the inputs are in the correct format. You should assume the year entered will always be in the future. .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... . ................................................................................................................................................. [8]

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