0% found this document useful (0 votes)
23 views

Algorithms - Algorithm Fundamentals - Answers

Uploaded by

jaspal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Algorithms - Algorithm Fundamentals - Answers

Uploaded by

jaspal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Algorithm Fundamentals Name:

Algorithms Score: /
GCSE Computer Science Questions & Answers

Q1 [2 marks]

A programmer mistakenly tries to shorten the subroutine in Figure 2 by replacing the


lines:

Explain why this change is a mistake.

AQA (2016 Spec) - Specimen Question Paper - Paper 1 /2

Q2 [1 mark]

What value is returned by the subroutine call TotalOut(x, 0) where x is any positive
integer?

AQA (2016 Spec) - Specimen Question Paper - Paper 1 /1

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

WHILE distance > 0

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.

The kitchen computer system stores an abstract representation of each student.

Describe what is meant by abstraction.

OCR (2016 Spec) - Dec 17 Practice Question Paper - Paper 2 /2

Q5 Explain why abstraction is used by the school kitchen when storing details for each [2 marks]
student.

OCR (2016 Spec) - Dec 17 Practice Question Paper - Paper 2 /2

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.

Complete the algorithm below which implements this restriction.

OCR (2016 Spec) - Dec 17 Practice Question Paper - Paper 2 /2

Q8 Define the term algorithm. [2 marks]

AQA (2015 Spec) - Specimen Question Paper - Paper 2 /2

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

Q1 1 mark for each correct answer to a maximum of two.

The value of c is constant/does not change;


(a+b)/a/b may change;
There is a logical error;

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;

The two correct versions are shown below.

The correct instructions are shown in bold:

Q4 1 mark per bullet to max 2


- Obscuring of unnecessary detail
- So the main processes/data can be more easily understood/focused on

Q5 1 mark per bullet to max 2


- To reduce complexity of the student representation…
- …to therefore make the implementation simpler / more efficient / quicker

Q6 1 mark per bullet to max 2. Mark in pairs.


E.g.
- Teacher would hold details of marks/grades…
- …Kitchen system would not need academic information
- Kitchen may hold details of food allergies/school meal choices/payment information…
- …Teacher would not need information about dietary requirements

Q7 1 mark per bullet to max 2.


- MOD
- else

Q8 A series of instructions//sequence of steps; (Designed to) perform a particular task//solve a


problem; A. Other wording

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

- Decomposition: Which computers should it be compatible with?


- Abstraction: Ignore computers and OS’s older than 10 years. Focus on new systems.

- Decomposition: Are there any competitor keyboards?


- Abstraction: Ignore make and model names. Focus on price, features and quality.

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.

You might also like