2.1.3 Thinking Procedurally Exam Questions
Paper 2 · Algorithms & Programming · 7 past paper questions · 2 practice questions · 36 marks
Exam questions for 2.1.3 Thinking procedurally
7 OCR past paper questions and 2 practice questions (36 marks) with mark schemes
Answer each question, reveal the mark scheme, then award yourself marks. Scores and answers are saved in this browser so you can see which topics need more work.
Download Questions & Mark Scheme (PDF)Past paper questions
- Question 1H446/023 marks
Eve would like to break a board game problem down into smaller sub problems so that each sub problem will complete one specific task. Identify three sub problems that Eve can use in her game.
Show mark scheme
1 mark per bullet: Initialising a new board with 100 squares / Placing players on square 1 / Setting a new 30-minute timer / Rolling two dice and displaying the total / Moving the counters / Choosing an instruction card / Checking if a player has landed on square 100 / Checking if the timer is 0Mark yourself: how many marks did you get?/ 3 - Question 2H446/02 · June 20232 marks
A program is being designed that will allow a user to log into an account using a username and password. Identify two possible sub-procedures that could be used in this program.
Show mark scheme
Connect to database / Access usernames in file/database / Check username against file/database / Hash password / Access password/hash in file/database / Check password entered vs stored / Output result (2 marks)Mark yourself: how many marks did you get?/ 2 - Question 3H446/02 · June 20196 marks
Mabel is a software engineer. She is writing a computer game for a client. The computer game allows a user to select a character (e.g. name, gender). They can then choose a level for the game (easy, normal, challenging). The user controls their character by moving it left or right. The character can jump using space bar as an input. If the character touches one of the enemies then it loses a life. The character has to make it to the end of the level without losing all their lives. The game is designed in a modular way. One sub-procedure will handle the user input. Describe three other sub-procedures Mabel could create for the given game description.
Show mark scheme
1 mark for name, 1 mark for description (max 6): Character selection / Level selection / Enemy movement / Collision detection / Life counter / End game check / Score display / Animation handlerMark yourself: how many marks did you get?/ 6 - Question 4H446/02 · June 20192 marks
Mabel is a software engineer. She is writing a computer game for a client. The computer game allows a user to select a character (e.g. name, gender). They can then choose a level for the game (easy, normal, challenging). The user controls their character by moving it left or right. The character can jump using space bar as an input. If the character touches one of the enemies then it loses a life. The character has to make it to the end of the level without losing all their lives. The game is designed in a modular way. One sub-procedure will handle the user input. Describe the decision that the program will need to make within the user input sub-procedure and the result of this decision.
Show mark scheme
Check which key has been pressed (left, right, space) / Based on key, move character in that direction or make character jump (2 marks)Mark yourself: how many marks did you get?/ 2 - Question 5H446/02 · June 20192 marks
Define pipelining and give an example of how it could be applied in a game program.
Show mark scheme
Pipelining: Breaking a task into stages that can be processed concurrently/overlapping execution. Example: While one frame is being displayed, the next is being rendered, while physics calculations happen for the frame after that (2 marks)Mark yourself: how many marks did you get?/ 2 - Question 6H446/024 marks
Janet is designing software for a furniture company to plan the position of furniture in a room. Explain the benefits of using subprograms to produce this software.
Show mark scheme
Easier to test individual components / Allows code reuse / Multiple programmers can work on different parts / Easier to maintain/debug / Reduces complexity / Can be developed independently / Promotes abstraction (4 marks - 1 per valid point)Mark yourself: how many marks did you get?/ 4 - Question 7H446/026 marks
Complete the table identifying three additional sub-procedures for a computer game and describe the purpose of each.
Sub-procedure Purpose Show mark scheme
Examples: loadScreen - displays initial loading graphics / mapSelection - allows player to choose area / puzzleSolver - checks if puzzle is complete / saveGame - writes game state to file / displayScore - shows current score on screen (6 marks - 1 for name, 1 for description each)Mark yourself: how many marks did you get?/ 6 - Question 8Practice question · H446/02 style5 marks
A school wants a program to produce a timetable for a parents' evening. Each parent books 10-minute appointments with up to five teachers between 4 pm and 7 pm, and no teacher or parent can be in two places at once. Identify the components of this problem and describe the order in which the program must carry out its steps, giving a reason for the order.
Show mark scheme
1 mark for each point, to a maximum of 5: • Components of the problem: teachers and their availability; parents and the teachers they want to see; the time slots; the clash rules • Components of the solution: input/store teacher availability; input/store parent requests; allocate requests to slots; check for clashes; output the timetable • Order: all availability and requests must be collected before any allocation is made, because an allocation depends on that data • A clash check must follow each allocation (or run before output), because a slot can only be judged free once the other appointments are known • Output comes last, once every request has been allocated or reported as impossibleMark yourself: how many marks did you get?/ 5 - Question 9Practice question · H446/02 style6 marks
A programmer is writing a quiz program. Describe three sub-procedures that the program could be decomposed into. For each sub-procedure, state its inputs and its output.
Show mark scheme
1 mark for each sensible sub-procedure and 1 mark for correct inputs and output, to a maximum of 6. For example: • loadQuestions: input a file name; output a list of questions and answers • askQuestion: input one question; output the user's answer • checkAnswer: inputs the user's answer and the correct answer; output true/false or the points scored • updateScore: inputs the current score and the points scored; output the new score • displayResult: input the final score and the number of questions; output a message or percentage Accept any sub-procedures that each do one job and have clearly stated inputs and output.Mark yourself: how many marks did you get?/ 6
- 1Decomposition: Top-down design, break until manageable; Benefits for teamwork
- 2Sub-procedures: Clear inputs/outputs; Can be developed independently
- 3Dependencies: Some steps must happen in specific order
- •Practice answering questions under timed conditions
- •Check your answers against the mark scheme carefully
- •Focus on understanding the marking points, not just memorising answers
- •Review past paper questions from multiple years to spot patterns