Algorithms - Algorithm Fundamentals - Answers
Algorithms - Algorithm Fundamentals - Answers
Algorithms Score: /
GCSE Computer Science Questions & Answers
Q1 [2 marks]
Q2 [1 mark]
What value is returned by the subroutine call TotalOut(x, 0) where x is any positive
integer?
Q3 A robot needs to visit every square in the following grid that does not contain an object: [4 marks]
The objects are shown as black squares.
Complete the algorithm by writing the following instructions in the correct places (you
will need to use each instruction exactly once):
Forward(distance)
distance ← distance - 1
distance ← 4
TurnLeft()
TurnLeft()
Forward(distance)
ENDWHILE
AQA (2016 Spec) - Specimen Question Paper - Paper 1 /4
Q4 A school kitchen stores details of each student in the school so that students are able [2 marks]
to pay for school meals.
Q5 Explain why abstraction is used by the school kitchen when storing details for each [2 marks]
student.
Q6 Teachers and school kitchen staff use different abstract representations of a student. [2 marks]
Explain one way in which these abstract representations differ.
OCR (2016 Spec) - Dec 17 Practice Question Paper - Paper 2 /2
Q7 Each appointment must be in blocks of 15 minutes. For example, an appointment for 2 [2 marks]
hours and 45 minutes would be allowed but an appointment for 1 hour and 17 minutes
would not be allowed.
Q9 A hardware company plans to make a computer keyboard for Greek language [4 marks]
students. Complete the missing rows in the table below to show the decomposition and
abstraction steps the hardware company might take when making the keyboard.
Decomposition Abstraction
AQA Workbook /4
Q10 A file uploading service won't allow two files with the same file name to be uploaded. If [3 marks]
a file name already exists, it will ask the user to change the file name.
Describe with examples how abstraction can help decide how to compare the files.
AQA Workbook /3
Q11 A file uploading service won't allow two files with the same file name to be uploaded. If [3 marks]
a file name already exists, it will ask the user to change the file name.
Describe with examples how decomposition could be used to help program this task.
AQA Workbook /3
Answers
Q2 0;
Q3
distance ← 4
WHILE distance > 0
Forward(distance)
TurnLeft()
Forward(distance)
TurnLeft()
distance ← distance – 1
ENDWHILE
Mark as follows:
1 mark for 1 correct instruction in the correct place;
2 marks for 2 correct instructions in the correct place;
3 marks for 3 correct instructions in the correct place;
4 marks for all 5 correct instructions in the correct place;
Q9 Any two decomposition and matching abstraction. 1 Mark per decomposition, 1 mark per
abstraction.
E.g
- Decomposition: What will the keyboard look like?
- Abstraction: Ignore the colour and material. Focus on layout and size
Q10 3 marks available - 1 mark for a definition of abstraction, 1 mark for an example of a detail to
ignore, one mark for an example of a detail to focus on.
E.g
- Abstraction Is picking out important details and ignoring the irrelevant ones
- File uploading service should ignore details like the contents of each file
- File uploading service should focus on details like the file names.
Q11 3 marks available - 1 mark for a definition of decomposition, up to two marks available for
different examples of decomposition.
E.g
- Decomposition Is breaking down the problem into smaller problems.
- A programmer may focus on how till the service keep track of files already uploaded
- Or How will files be compared. And solve the problems individually.