2.1.1 Computational thinking Practice Questions
GCSE · Paper 2 · Computational thinking, algorithms and programming · 10 practice questions · 35 marks
Exam questions for 2.1.1 Computational thinking
10 practice questions (35 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.
Practice questions
- Question 1Practice question · J277/02 style2 marks
Describe what is meant by abstraction.
Show mark scheme
Removing or hiding details that are not needed / not relevant [1] so that only the important features of the problem are left / the problem is simpler [1]
Mark yourself: how many marks did you get?/ 2 - Question 2Practice question · J277/02 style2 marks
A teacher is writing a program to store the marks of students in a test. State one piece of information that could be left out by abstraction and explain why.
Show mark scheme
Any one detail not needed to store marks, for example the student's favourite colour, their home address or their shoe size [1] because it is not needed to store or work with the marks [1]
Mark yourself: how many marks did you get?/ 2 - Question 3Practice question · J277/02 style3 marks
A company is building a program for an online pizza shop. The programmers split the work into: taking the order, working out the price and printing the delivery note. (a) Name the technique the programmers have used. [1] (b) Give two benefits of using this technique. [2]
Show mark scheme
(a) Decomposition [1] (b) Any two from: [2] Each part is smaller, so it is easier to understand / write / test Different programmers can work on different parts at the same time Parts can be reused in other programs If there is an error it is easier to find which part is causing it
Mark yourself: how many marks did you get?/ 3 - Question 4Practice question · J277/02 style3 marks
For each statement, write abstraction, decomposition or algorithmic thinking. (a) A game designer draws a map showing only the roads and the finish line, with no trees or houses. [1] (b) A designer writes down the steps to check a password: get the password, check it is at least 8 characters, then show a message. [1] (c) A developer splits a school timetable program into entering the lessons, placing the lessons and printing the timetable. [1]
Show mark scheme
(a) Abstraction [1] (b) Algorithmic thinking [1] (c) Decomposition [1]
Mark yourself: how many marks did you get?/ 3 - Question 5Practice question · J277/02 style4 marks
A bank is designing a cash machine. Describe how abstraction and decomposition could each be used when designing the cash machine.
Show mark scheme
Abstraction (max 2): The screen shows only the options the user needs (such as withdraw cash and check balance) [1] and hides how the bank stores the account records / how the money is counted [1] / leaves out details such as the customer's address that the machine does not need Decomposition (max 2): The cash machine job is broken into smaller parts such as: check the card and PIN, show the options, give out the cash, print the receipt [1] each part can be written and tested separately / by different people [1]
Mark yourself: how many marks did you get?/ 4 - Question 6Practice question · J277/02 style3 marks
The following program uses a function called `ticketPrice` that returns 0 if age is below 5, 4 if age is below 16 and 8 otherwise.
01 total = 0 02 for i = 1 to 3 03 age = int(input("Enter age")) 04 total = total + ticketPrice(age) 05 next i 06 print("Total: " + str(total))The user enters the ages 16, 4 and 5. State the value printed and show how you worked it out.
Show mark scheme
Total: 12 [1 for the correct output] Method: 16 is not below 16, so the price is 8 [1] / 4 is below 5, so the price is 0 [1] / 5 is below 16 but not below 5, so the price is 4 [1] 8 + 0 + 4 = 12 Award a maximum of 3 marks: 1 mark for the answer and up to 2 for correct working.
Mark yourself: how many marks did you get?/ 3 - Question 7Practice question · J277/02 style5 marks
A school wants a program that reads 5 test scores typed in by a teacher and outputs the highest score. Write an algorithm for this program using the OCR Exam Reference Language or a high-level programming language.
Show mark scheme
Example answer:
highest = 0 for i = 1 to 5 score = int(input("Enter score")) if score > highest then highest = score endif next i print(highest)Award marks for: Variable set to a starting value before the loop (for example 0) [1] A loop that repeats exactly 5 times [1] Input of the score inside the loop and converted to a number [1] A comparison of the score with the highest so far and updating highest when it is bigger [1] Output of the highest after the loop has ended [1] Accept any correct alternative, for example a loop that sets highest to the first score.
Mark yourself: how many marks did you get?/ 5 - Question 8Practice question · J277/02 style3 marks
A teacher wrote this program to count how many of 5 students have passed a test. A score of 50 or more is a pass.
01 count = 0 02 for i = 0 to 5 03 score = input("Enter score") 04 if score >= 50 then 05 count = count + 1 06 endif 07 print(count)The program has three errors. Identify each error and write the correction.
Show mark scheme
Any three from: [3] Line 02: the loop runs 6 times (0 to 5 includes 5) / correct it to for i = 0 to 4 (or for i = 1 to 5) Line 03: input returns a string, so it should be converted to a number / score = int(input("Enter score")) Line 07: next i is missing at the end of the loop (before the print) / add next i after endif Award 1 mark for each error identified and corrected.
Mark yourself: how many marks did you get?/ 3 - Question 9Practice question · J277/02 style4 marks
Dev is making a program to help people plan a walk. He starts with this outline: 1. Ask for the distance. 2. Work out how long the walk will take. 3. Show the answer. Refine step 2 into at least three smaller steps. Assume people walk 5 kilometres each hour.
Show mark scheme
Example answer, any three steps from: [3] Store the distance entered as a number Divide the distance by 5 to get the hours Multiply the hours by 60 to get the minutes (if the answer is needed in minutes) Store the result in a variable Award 1 mark for each step that is a clear, smaller step in the right order, up to 3 marks. Award 1 further mark if the steps together give a correct result (distance divided by 5 gives hours) [1]
Mark yourself: how many marks did you get?/ 4 - Question 10Practice question · J277/02 style6 marks
A leisure centre wants a program to take online bookings for the swimming pool. Explain how the developers could use decomposition and algorithmic thinking to create the program. Use examples from the scenario.
Show mark scheme
Decomposition (up to 3 marks): The problem is broken into smaller parts [1] for example choose a day and time / enter the swimmer's details / check there is space / take payment / send confirmation [1] each part can be written and tested separately, or given to different people [1] Algorithmic thinking (up to 3 marks): Work out the inputs (such as the day, the time and the number of swimmers) and the outputs (such as a confirmation) [1] Work out the steps in a clear order, for example check the space left, then take the booking [1] Use selection (if there is no space left, show a message) / use iteration (repeat for each swimmer in the group) [1]
Mark yourself: how many marks did you get?/ 6
- •Practice answering questions under timed conditions
- •Check your answers against the mark scheme carefully
- •Focus on understanding the marking points, not just memorising answers
- •Come back to the questions you dropped marks on a few days later