0% found this document useful (0 votes)
58 views328 pages

A Level Cs PPQ Merged Booklet 23-24

The document outlines the AQA A Level Computer Science specification for 2023-24, including specimen and past paper booklets along with mark schemes. It contains various sections including specifications, specimen papers, and past examination papers from multiple years. Additionally, it provides instructions, materials needed for the exam, and advice on time management during the examination.

Uploaded by

jamesmfenna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views328 pages

A Level Cs PPQ Merged Booklet 23-24

The document outlines the AQA A Level Computer Science specification for 2023-24, including specimen and past paper booklets along with mark schemes. It contains various sections including specifications, specimen papers, and past examination papers from multiple years. Additionally, it provides instructions, materials needed for the exam, and advice on time management during the examination.

Uploaded by

jamesmfenna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 328

COMPUTER SCIENCE

AQA A LEVEL
2023-24

SPECIMEN & PAST-PAPER BOOKLETS


MARKSCHEMES AND SPEC AT:
bit.ly/csaqapapers
CONTENTS

1. SPECIFICATION
2. SPECIMEN PAPER 1
3. (SPEC 1 ADDITIONAL QUESTIONS)
4. SPECIMEN PAPER 2
5. (SPEC 2 ADDITIONAL QUESTIONS)
6. JUN 17 PAPER 1 (SECTIONS A-B)
7. JUN 17 PAPER 2
8. JUN 18 PAPER 1 (SECTIONS A-B)
9. JUN 18 PAPER 2
10. JUN 19 PAPER 1 (SECTIONS A-B)
11. JUN 19 PAPER 2
12. NOV 20 PAPER 1 (SECTIONS A-B)
13. NOV 20 PAPER 2
14. NOV 21 PAPER 1 (SECTIONS A-B)
15. NOV 21 PAPER 2
16. JUN 22 PAPER 1 (SECTIONS A-B)
17. JUN 22 PAPER 2
SPECIMEN MATERIAL

A-level
COMPUTER SCIENCE
(7517/1A/1B/1C/1D/1E)
Paper 1

Specimen 2015 am/pm Time allowed: 2 hours 30 minutes


Materials
• For this paper you must have access to:
• a computer
• a printer
• appropriate software.
• An electronic version of the Skeleton Program and Data File.
• A hard copy of the Preliminary Material.

Instructions
• Type the information required on the front of your Electronic Answer Document.
• Enter your answers into the Electronic Answer Document.
• Answer all questions.
• Before the start of the examination make sure your centre number, candidate name and
candidate number are shown clearly in the footer of every page of your Electronic Answer
Document (not the front cover).
• Tie together all your printed Electronic Answer Document pages and hand them to the
invigilator.

Information
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100.
• No extra time is allowed for printing and collating.
• The question paper is divided into four sections.
• You are not allowed to use a calculator.

Advice
• You are advised to spend time on each section as follows:
Section A – 55 minutes
Section B – 20 minutes
Section C – 15 minutes
Section D – 60 minutes.
• Save your work at regular intervals.
2

Section A

You are advised to spend no more than 55 minutes on this section.

Enter your answers to Section A in your Electronic Answer Document.

You must save this document at regular intervals.

0 1 The famous detective John Stout was called in to solve a perplexing murder
mystery. He determined the following facts.

(a) Nathan, the murdered man, was killed by a blow on the head.
(b) Either Suzanne or Martin was in the dining room at the time of the murder.
(c) If Peter was in the kitchen at the time of the murder, then Ian killed Nathan
using poison.
(d) If Suzanne was in the dining room at the time of the murder, then Steve
killed Nathan.
(e) If Peter was not in the kitchen at the time of the murder, then Martin was
not in the dining room when the murder was committed.
(f) If Martin was in the dining room at the time the murder was committed, then
Paul killed Nathan.
(g) If Kevin was in the hall at the time of the murder, then Suzanne killed
Nathan by a blow to the neck with a saucepan.

0 1 . 1 Who murdered Nathan?

A Paul
B Steve
C Suzanne
D Ian
E It is not possible for John Stout to solve the crime.

Write the letter corresponding to the correct answer in the box provided in your
Electronic Answer Document.

[1 mark]

0 1 . 2 Explain how you know your answer to 0 1 . 1 is correct.

[2 marks]

Use the space below for rough working, then write your answer in your Electronic
Answer Document.
3

0 2 A finite state machine (FSM) can be used to define a language: a string is allowed in a
language if it is accepted by the FSM that represents the rules of the language.
Figure 1 shows the state transition diagram for an FSM.

Figure 1

1 1, 0
S2 S4
1
0
S1
1
0
S3 0

An FSM can be represented as a state transition diagram or as a state transition table.


Table 1 is an incomplete state transition table for Figure 1.

Complete Table 1 and copy the table into the Electronic Answer Document.
0 2 . 1

Table 1

Original state Input New state


S3
S3

[1 mark]

Any language that can be defined using an FSM can also be defined using a regular
expression.

The FSM in Figure 1 defines the language that allows all strings containing at least,
either two consecutive 1s or two consecutive 0s.

The strings 0110, 00 and 01011 are all accepted by the FSM and so are valid strings
in the language.

The strings 1010 and 01 are not accepted by the FSM and so are not valid strings in
the language.

0 2 . 2 Write a regular expression that is equivalent to the FSM shown in Figure 1.

[3 marks]

Question 2 continues on the next page

Turn over 
4

Backus-Naur Form (BNF) can be used to define the rules of a language.

Figure 2 shows an attempt to write a set of BNF production rules to define a language
of full names.

Figure 2

Note: underscores (_) have been used to denote spaces.


Note: rule numbers have been included but are not part of the BNF
rules.

Rule
number
1 <fullname> ::= <title>_<name>_<endtitle> |
<name> |
<title>_<name> |
<name>_<endtitle>

2 <title> ::= MRS | MS | MISS | MR | DR | SIR

3 <endtitle> ::= ESQUIRE | OBE | CBE

4 <name> ::= <word> |


<name>_<word>

5 <word> ::= <char><word>

6 <char> ::= A | B | C | D | E | F | G | H | I |
J | K | L | M | N | O | P | Q | R |
S | T | U | V | W | X | Y | Z

BNF can be used to define languages that are not possible to define using regular
expressions. The language defined in Figure 2 could not have been defined using
regular expressions.

0 2 . 3 Complete Table 2 below by writing either a ‘Y’ for Yes or ‘N’ for No in each row.

Table 2

Rule number Could be defined using a regular expression


(given in Figure 2)
1
2
3
4
5
6

Copy your answer in Table 2 into the Electronic Answer Document.

[1 mark]
5

There is an error in rule 5 in Figure 2 which means that no names are defined by the
language.

0 2 . 4 Explain what is wrong with the production rule and rewrite the production rule so that
the language does define some names – the names ‘BEN D JONES’, ‘JO
GOLOMBEK’ and ‘ALULIM’ should all be defined.

[2 marks]

Turn over for the next question

Turn over 
6

0 3 The Cat transportation company (CTC) is a business that specialises in preparing cats
for cat shows.

They need to take five cats to the AQA cat show. They will transport the cats in their
van. CTC owns only one van.

They cannot put all the cats in their van at the same time because some of the cats
get stressed when in the company of some of the other cats. The cats would not
therefore arrive in top condition for the cat show if they were all in the van at the same
time.

The graph in Figure 3 shows the relationships between the five cats (labelled 1 to 5).
If there is an edge between two cats in the graph then they cannot travel in the van
together at the same time.

Figure 3

1 2

4 3

0 3 . 1 Explain why the graph in Figure 3 is not a tree.

[1 mark]

0 3 . 2 Represent the graph shown in Figure 3 as an adjacency list by completing Table 3.

Complete Table 3 and copy the table into the Electronic Answer Document.

[2 marks]

Table 3

Vertex (in Figure 3) Adjacent vertices


1
2
3
4
5
7

Table 4 shows how the graph in Figure 3 can be represented as an adjacency matrix.

Table 4

Vertex (in Figure 3) 1 2 3 4 5


1 0 1 1 0 0
2 1 0 1 1 0
3 1 1 0 0 1
4 0 1 0 0 0
5 0 0 1 0 0

0 3 . 3 Explain the circumstances in which it is more appropriate to represent a graph using


an adjacency list instead of an adjacency matrix.
[2 marks]

Question 3 continues on the next page

Turn over 
8

Figure 4 shows an algorithm, written in pseudo-code, that CTC use.

Figure 4

NoOfCats  5
Cat[1]  1
FOR A  2 TO NoOfCats
B  1
C  1
WHILE B < A DO
IF M[A, B] = 1
THEN
IF Cat[B] = C
THEN
B  1
C  C + 1
ELSE B  B + 1
ENDIF
ELSE B  B + 1
ENDIF
ENDWHILE
Cat[A]  C
ENDFOR

The two-dimensional array, M, is used to store the adjacency matrix shown


in Table 4.
9

0 3 . 4 Complete Table 5 to show the result of tracing the algorithm in Figure 4.

[6 marks]
Copy your answer in Table 5 into the Electronic Answer Document.

Table 5
Cat
NoOfCats A B C 1 2 3 4 5

0 3 . 5 Explain the purpose of the algorithm in Figure 4.


[1 mark]

After a cat show, CTC needs to return the cats to their owners. They can have all
the cats in the van at the same time because the show is now finished.

CTC likes to plan the return journey so that the shortest possible distance is
travelled by the van. This is an example of an intractable problem.

0 3 . 6 What is meant by an intractable problem?

[2 marks]

0 3 . 7 What approach might a programmer take if asked to solve an intractable problem?

[2 marks]

Turn over 
10

0 4 Figure 5 shows an incomplete algorithm for a binary search.

Figure 5

PROCEDURE BSearch(List, F, L,
ItemToFind)
Found  False
Failed  (1)................................
WHILE NOT Failed AND NOT Found
M  (F + L) DIV 2
IF List[M] = ItemToFind
THEN Found  True
ELSE
IF F >= L
(2).........................................
ELSE
IF List[M] > ItemToFind
THEN (3).........................................
ELSE F  M + 1
ENDIF
ENDIF
ENDIF
ENDWHILE
IF Found = True
THEN OUTPUT "Item is in list"
ELSE OUTPUT "Item is not in list"
ENDIF
ENDPROCEDURE

The DIV operator calculates the whole number result of integer division. For
example, 15 DIV 4 = 3, 17 DIV 4 = 4.

0 4 . 1 What code should be added at position (1) in Figure 5?

[1 mark]

0 4 . 2 What code should be added at position (2) in Figure 5?

[1 mark]

0 4 . 3 What code should be added at position (3) in Figure 5?

[2 marks]
11

Table 6 contains a list of orders of time complexity (in no particular order).

Table 6

Order of time
complexity
O(1)
O(n2)
O(log n)
O(kn)
O(n)

Which of the orders of time complexity given in Table 6:

0 4 . 4 could be the time complexity of an intractable problem?


[1 mark]

0 4 . 5 is the time complexity for a binary search?

[1 mark]

0 4 . 6 is the time complexity for getting the first item in a list?

[1 mark]

0 4 . 7 is the time complexity for a linear-search algorithm?

[1 mark]

0 4 . 8 Explain why a linear-search has the order of time complexity given in your answer
to question 0 4 . 7 .

[2 marks]

Turn over 
12

0 5 Convert the following Reverse Polish Notation expressions to their equivalent infix
expressions.

0 5 . 1 3 4 *

[1 mark]

0 5 . 2 12 8 + 4 *

[1 mark]

Reverse Polish Notation is an alternative to standard infix notation for writing


arithmetic expressions.

0 5 . 3 State one advantage of Reverse Polish Notation over infix notation.

[1 mark]

END OF SECTION A

Section B begins on page 14


14

Section B

You are advised to spend no more than 20 minutes on this section.

Enter your answers to Section B in your Electronic Answer Document.

You must save this document at regular intervals.

The question in this section asks you to write program code starting from a new
program/project/file.

• Save your program/project/file in its own folder/directory.


• Save your program/project/file at regular intervals.

0 6 Create a folder/directory called Question6 for your new program.

One method for converting a decimal number into binary is to repeatedly divide by 2
using integer division. After each division is completed, the remainder is output and
the integer result of the division is used as the input to the next iteration of the
division process. The process repeats until the result of the division is 0.

Outputting the remainders in the sequence that they are calculated produces the
binary digits of the equivalent binary number, but in reverse order.

For example, the decimal number 210 could be converted into binary as shown in
Figure 7.

Figure 7

210 ÷ 2 = 105 remainder 0


105 ÷ 2 = 52 remainder 1
52 ÷ 2 = 26 remainder 0
26 ÷ 2 = 13 remainder 0
13 ÷ 2 = 6 remainder 1
6÷2= 3 remainder 0
3÷2= 1 remainder 1
1÷2= 0 remainder 1

The sequence 0, 1, 0, 0, 1, 0, 1, 1 which would be output by this process is the


reverse of the binary equivalent of 210 which is 11010010.
15

What you need to do

Task 1
Write a program that will perform the conversion process described above. The
program should display a suitable prompt asking the user to input a decimal number to
convert and then output the bits of the binary equivalent of the decimal number in
reverse order.

Task 2
Improve the program so that the bits are output in the correct order, e.g. for 210 the
output would be 11010010.

Task 3
Test the program works by entering the value 210.

Save the program in your new Question6 folder/directory.

Evidence that you need to provide


Include the following in your Electronic answer document.

0 6 . 1 Your PROGRAM SOURCE CODE after you have completed both Task 1 and
Task 2.

If you complete Task 1 but do not attempt Task 2 then a maximum of 9 marks will
be awarded.
[12 marks]

0 6 . 2 SCREEN CAPTURE(S) for the test showing the output of the program when 210 is
entered.

The marks for this test will be awarded whether the binary digits are output in
reverse order or in the correct order.
[2 marks]

END OF SECTION B

Turn over for Section C

Turn over 
Specimen material

A-level
COMPUTER SCIENCE

Paper 1
Additional Questions

IMPORTANT NOTES
These questions focus primarily on topics that were not covered by the AQA AS and A-level
Computing specifications, introduced in 2009. It is hoped that teachers will find questions on these
new topics to be particularly useful.

Many example questions on topics that are common to the new and old specifications can be found
on past papers for COMP1, 2 and 3 on our website. Past papers that are more than three years old
can be accessed via e-AQA.

This document contains additional questions; it is not intended to be treated as a complete paper.
The questions do not provide balance coverage of the specification or the assessment objectives in
the same way that a fully live paper would do.

7517A/B/C/D/E
2

0 1 Table 1 contains a list of problems.

Table 1

Letter Problem
A Finding the shortest route that visits all nodes in a graph exactly once
B Finding the shortest path between two nodes in a graph
C Finding an item in a large unordered list
D Finding a route between two nodes in a graph
E Finding out if any program will eventually stop if given a particular input

0 1 . 1 State the letter (A-E) that corresponds to the problem that Dijksta’s Algorithm
is designed to solve.

Write the letter corresponding to the correct answer in the box provided in your
Electronic Answer Document.
[1 mark]

0 1 . 2 State the letter (A-E) that corresponds to an intractable problem.

Write the letter corresponding to the correct answer in the box provided in your
Electronic Answer Document.
[1 mark]

0 1 . 3 Explain the significance of problem E for computation.


[1 mark]
3

0 2 Figure 1 contains pseudo-code for a recursive merge sort algorithm. Figure 2 contains
pseudo-code for an algorithm called Merge that is called by the merge sort algorithm in
Figure 1.

Figure 1

FUNCTION MergeSort(L, S, E)
IF S < E THEN
M  (S + E) DIV 2
L1  MergeSort(L, S, M)
L2  MergeSort(L, M + 1, E)
RETURN Merge(L1, L2)
ELSE
RETURN Append([], L[S])
ENDIF
ENDFUNCTION

Figure 2

FUNCTION Merge(L1, L2)


L3  []
WHILE Len(L1) > 0 AND LEN(L2) > 0
IF L1[1] < L2[1] THEN
L3  Append(L2[1], L3)
L2  RemoveFirstItem(L2)
ELSE
L3  Append(L1[1], L3)
L1  RemoveFirstItem(L1)
ENDIF
ENDWHILE
WHILE Len(L1) > 0
L3  Append(L1[1], L3)
L1  RemoveFirstItem(L1)
ENDWHILE
WHILE Len(L2) > 0
L3  Append(L2[1], L3)
L2  RemoveFirstItem(L2)
ENDWHILE
RETURN L3
ENDFUNCTION

The RemoveFirstItem function takes a list and returns a list that contains all the items in
the original list except the first one. For example, if Names is the list ["Gemma",
"Richard", "Georgina", "Margaret"] then the function call
RemoveFirstItem(Names) will return the list ["Richard", "Georgina",
"Margaret"].
4

The Len function takes a list and returns the number of items that are in the list. For
example, if Names is the list ["Gemma", "Richard", "Georgina",
"Margaret"] then the function call Len(Names) will return the value of 4.

The Append function takes an item and a list and returns a list that has all the items from the
original list followed by the item. For example, if Names is the list ["Gemma",
"Richard", "Georgina", "Margaret"] then the function call Append("Matt",
Names) will return the list ["Gemma", "Richard", "Georgina", "Margaret",
"Matt"].

The first item in the list has an index of 1.

What is meant by a recursive subroutine?


0 2 . 1
[1 mark]

0 2 . 2 What is the base case for the subroutine MergeSort?


[1 mark]

Complete Table 1 to show the result of tracing the MergeSort algorithm shown in
0 2 . 3
Figure 1 with the function call MergeSort(ListToSort, 1, 5).
ListToSort is the list [6, 3, 4, 8, 5]. The first six rows and the Call
number column have been completed for you.

Copy your answer in Table 1 into the Electronic Answer Document.

Table 1

Call number S E M List returned


1 1 5 3
2 1 3 2
3 1 2 1
4 1 1 [6]
3 1 2 1
5 2 2 [3]
3
2
6
2
1
7
8
7
9
7
1

[6 marks]
5

0 2 . 4 What is the time complexity for the MergeSort algorithm shown in Figure 1?
[1 mark]

A stack frame is used with subroutine calls.

0 2 . 5 State two items that will be stored in a stack frame for a subroutine call.
[2 marks]

When the subroutine call MergeSort(ListToSort, 1, 5)is made four is the


largest number of stack frames, generated by this subroutine call, that will be on the
stack at any one time.

Explain why there will be three occasions when there will be four stack frames on the
0 2 . 6
stack when the subroutine call MergeSort(ListToSort, 1, 5)is made.
[2 marks]

Turn over for the next question


6

0 3 Three different types of relationship that can exist between objects in object-orientated
programming are aggregation, composition and inheritance.

0 3 . 1 State one reason why many programmers follow the design principle “favour
composition over inheritance”.
[1 mark]

An object-oriented program is being written to store details about clients at an estate


agency. Clients can be either sellers or prospective buyers.

A class Client has been created and two subclasses, Seller and Buyer are to
be developed. A Location class has been created to store details about an
address (eg postcode and street name)

The Client class has data fields Name, Address and DOB.

Part of the class definition for Client class is:

Client = Class {
Private:
Name: String
Address: Location
DOB: Date
Public:
Function GetName
Function GetDOB
Function GetAddress
Procedure SetDetails
}

A Buyer has the following additional data fields:


• NoOfBedroomsRequired: stores the minimum number of bedrooms that
the buyer requires in the house they purchase.
• OffStreetParking: stores a value indicating if the buyer requires off-
street parking or not.
• AreaDesired: the name of the town/village/estate that the buyer is looking
to purchase a house in.

0 3 . 2 Write the class definition for Buyer.


[4 marks]

Describe the relationships aggregation and composition, making it clear what the
0 3 . 3
difference between the two is.
[2 marks]

0 3 . 4 Explain how the Client class uses aggregation and why it was considered more
appropriate to use this type of relationship than composition.
[2 marks]
7

0 4 Figure 3 contains a list of different sets.

Figure 3

S1 = {a, b}
S2 = {a, b, c}
S3 = {0, 1, 2}
S4 = {a, ab}
S5 = {a, b, c}
S6 = {c}

0 4 . 1 What is a set?
[2 marks]

0 4 . 2 State the name of a set listed in Figure 3 that has the same cardinality as set S2.
[1 mark]

0 4 . 3 State the name of a set listed in Figure 3 that is a subset of set S2 but not a proper
subset of S2.
[1 mark]

0 4 . 4 Describe how set S6 could be created using the difference set operation together
with two of the other sets listed in Figure 3.
[1 mark]

0 4 . 5 What is the Cartesian product of sets S1 and S6?


[1 mark]

A regular expression is a way of describing a set.

0 4 . 6 Write down two different regular expressions that describe the set S4.
[2 marks]
8

0 5 A designer jewellery company have a scheme where people can pay a fee to
borrow one or more items of jewellery for a week. This scheme is often used by
actors and musicians attending awards ceremonies and parties.

A computer program running on the jewellery company’s server uses a dictionary


to store details about who is currently borrowing which item of jewellery. A
dictionary is a data structure that contains a collection of key-value pairs where the
value is accessed via the associated key. The key used in the dictionary is the
catalogue number of the item of jewellery and the key is the name of the client.

The current state of the dictionary is shown in Figure 4.

Figure 4

{1045 : 'Clark Gable', 1050 : 'Ingrid Bergman', 1052 : 'Katherine Hepburn', 2012 :
'Lauren Bacall'}

0 5 . 1 What value will be returned by a lookup operation using the key 1052?
[1 mark]

A hash table has been used to implement the dictionary. The hashing algorithm
that has been used is Catalogue Number MOD 100.

0 5 . 2 What value is returned by the hashing function when it is applied to the catalogue
number 1052?
[1 mark]

0 5 . 3 Explain how a value is stored in a hash table.


[4 marks]
9

When a large number of the possible positions in a hash table are filled it becomes
inefficient; rehashing is often used to sort out this problem.

0 5 . 4 Describe the steps involved in rehashing.


[3 marks]

The jewellery company would also like to be able to complete lookup operations
based on the client name to find out which items of jewellery are being borrowed by a
particular client.

0 5 . 5 Explain how the jewellery company could set up a dictionary with the name of the
client as the key and the catalogue numbers as the value.
[1 mark]
A-level
COMPUTER SCIENCE

Paper 2

TBC am/pm 2 hours 30 minutes

Materials
 There are no additional materials required for this paper.

Instructions
 Use black ink or black ball-point pen.
 Fill in the boxes at the bottom of this page.
 Answer all questions.
 Do all rough work in this book. Cross through any work that you do not want to be marked.
 You may use a calculator.

Information
 The marks for questions are shown in brackets.
 The maximum mark for this paper is 100.

Advice
 In some questions you may be required to indicate your answer by shading a lozenge. If you
wish to change your answer make sure that the incorrect answer is clearly crossed through with
an x.

Please write clearly, in block capitals, to allow character computer recognition.

Centre number Candidate number

Surname

Forename(s)

Candidate signature

Paper 2 V1.21 (FINAL DRAFT)


2

Answer all questions in the spaces provided.

0 1 Figure 1 shows how some of the components of a computer system can be connected
together.

Figure 1

B E

Controller C D Controller

Table 1 lists the names of six components in the column headings and the five letters
(A-E) from Figure 1 in the row headings.

For each row in Table 1, shade one lozenge, in the appropriate column, to indicate
which component in Figure 1 has been labelled with the row letter.

As an example, the first row has been completed for you, to indicate that component A
in Figure 1 is the Address bus.
[4 marks]

Table 1

Processor Address Data bus Main Keyboard Visual


bus memory display
unit
A

Paper 2 V1.21 (FINAL DRAFT)


3

0 2 The internal buses in a computer use parallel communication while most peripherals
communicate with a computer using serial communication.

0 2 . 1 Explain the differences between the ways in which parallel and serial communication
is carried out.
[2 marks]

Most peripherals, such as printers and keyboards, communicate with a computer


using a serial connection.

0 2 . 2 Apart from the widespread availability of USB (Universal Serial Bus) ports, explain
why peripherals usually use a serial communication method such as USB instead of
parallel communication.
[1 mark]

In communications systems, a distinction is made between the bit rate and the baud
rate.

0 2 . 3 Define the term baud rate.


[1 mark]

0 2 . 4 Explain how it is possible for the bit rate to be higher than the baud rate.
[1 mark]

Paper 2 V1.21 (FINAL DRAFT) Turn over 


4

0 3 A burglar alarm system is to be implemented that has the following sensors:

 a door sensor D that outputs TRUE when the door is open and FALSE when the
door is shut
 a pressure mat sensor M that outputs TRUE while a weight is detected on it and
FALSE when no weight is detected on it.

The alarm also has a key K that turns the alarm on and off. K outputs a TRUE signal
when the alarm is switched on and FALSE when the alarm is off.

The alarm output A sounds a bell. It should be TRUE if:

 the alarm is on AND


 either of the sensors D or M are set to the value TRUE.

0 3 . 1 In the space below, draw a logic circuit that will behave as described above for the
inputs D, M and K and the output A.
[2 marks]

D A

0 3 . 2 Write a Boolean expression to represent the logic of this alarm system.


[2 marks]
A=

Paper 2 V1.21 (FINAL DRAFT)


5

0 3 . 3 In this alarm system, the alarm bell will sound only while the door is open or a weight
is placed on the pressure mat. If someone who has stepped on to the mat moves off
it, or an open door is closed, the alarm bell will stop ringing.

A D-type flip-flop could be incorporated into the logic circuit so that the alarm bell
would continue to sound after a person closed the door or moved off the pressure
mat.

Explain how this could be achieved. In your answer refer to:

 why a D-type flip-flop would be suitable for this task


 where the D-type flip-flop would need to be inserted into the circuit
 what additional input the D-type flip-flop would need.

[3 marks]

Turn over for the next question

Paper 2 V1.21 (FINAL DRAFT) Turn over 


6

0 4 The phrase “Internet of Things” is used to describe the connection of many everyday
devices such as home heating controls, utility meters, cars and environmental sensors
to the Internet. It is believed that tens of billions of devices will be connected to the
Internet of Things by the end of the decade.

One anticipated use of the Internet of Things is to monitor the food that consumers
have inside their fridges. This data could be gathered automatically from consumers’
devices by retailers who sell food. Retailers could use the data to analyse consumer
consumption habits or automatically prepare deliveries for customers.

In the context of an Internet connected fridge, discuss the technologies that will be
required to make the Internet of Things work.

You may wish to consider how the data might be captured, how networking
technologies are changing to provide the necessary infrastructure, and how the data
gathered by retailers could be stored and processed, from a hardware and software
viewpoint.
[12 marks]

Paper 2 V1.21 (FINAL DRAFT)


7

12

Paper 2 V1.21 (FINAL DRAFT) Turn over 


8

0 5 The icon in Figure 2 is represented in a computer's memory as a bitmap image.

Figure 2
Row
1

10

Four different colours have been used in the icon.

Row 1 of the icon is represented in the computer's memory as the bit pattern:

1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1

0 5 . 1 What are the bit patterns that have been used to represent a grey pixel and a white
pixel?
[1 mark]
Grey pixel: White pixel:

0 5 . 2 State one possible 20-bit representation for Row 4 of the icon in Figure 2.
[1 mark]

Paper 2 V1.21 (FINAL DRAFT)


9

0 5 . 3 Calculate the number of bytes required to represent all the pixel data in the icon as a
bitmap.

Show your working.


[2 marks]

Answer:

0 5 . 4 When the bitmap is saved as a file, the file size is bigger than the answer to
0 5 . 3 . This is because metadata is saved in the file with the pixel data

State one item of metadata that would be stored in a bitmap file.


[1 mark]

Run-length encoding (RLE) is an example of a compression method that could be


used to reduce the amount of memory required to store the icon in Figure 2.

0 5 . 5 Describe the principle used by RLE to compress a file and explain why RLE is an
appropriate compression method for compressing images such as icons.
[3 marks]

Paper 2 V1.21 (FINAL DRAFT) Turn over 


10

0 6 Figure 3 shows the structure of an example machine code instruction, taken from the
instruction set of a particular processor.

Figure 3

Opcode Operand(s)
Basic Machine Addressing
Operation Mode
0 1 1 0 1 0 1 0 0 1 0 1 0 1 1

0 6 . 1 How many different basic machine operations could be supported by the instruction
set of the processor used in the example in Figure 3?
[1 mark]

Figure 4 shows an assembly language program together with the contents of a


section of the main memory of the computer that the program will be executed on.

The assembly language instruction set that has been used to write the program is
listed in Table 2.The lines of the assembly language program have been numbered to
help you answer question parts 0 6 . 2 to . 4.
0 6
1
Figure 4

Line Command Memory Main Memory


1 MOV R2, #100 Address Contents
2 LDR R3, 101 (in decimal) (in decimal)
3 ADD R2, R2, R3 100 23
4 LSL R3, R2, #1 101 10
5 HALT 102 62
103 18

0 6 . 2 What value will be stored in register R2 immediately after the command in line 1 has
been executed?
[1 mark]

0 6 . 3 What value will be stored in register R2 immediately after the program has executed
the commands from line 1 through to line 3?
[1 mark]

0 6 . 4 What value will be stored in register R3 after the complete program has finished
executing?
[1 mark]

Paper 2 V1.21 (FINAL DRAFT)


11

Table 2

LDR Rd, <memory ref> Load the value stored in the memory location specified by
<memory ref> into register d.
STR Rd, <memory ref> Store the value that is in register d into the memory location
specified by <memory ref>.
ADD Rd, Rn, <operand2> Add the value specified in <operand2> to the value in register n
and store the result in register d.
SUB Rd, Rn, <operand2> Subtract the value specified by <operand2> from the value in
register n and store the result in register d.
MOV Rd, <operand2> Copy the value specified by <operand2> into register d.
CMP Rn, <operand2> Compare the value stored in register n with the value specified by
<operand2>.
B <label> Always branch to the instruction at position <label> in the
program.
B<condition> <label> Conditionally branch to the instruction at position <label> in the
program if the last comparison met the criteria specified by the
<condition>. Possible values for <condition> and their
meaning are:

 EQ: Equal to.


 NE: Not equal to.
 GT: Greater than.
 LT: Less than.
AND Rd, Rn, <operand2> Perform a bitwise logical AND operation between the value in
register n and the value specified by <operand2> and store the
result in register d.
ORR Rd, Rn, <operand2> Perform a bitwise logical OR operation between the value in
register n and the value specified by <operand2> and store the
result in register d.
EOR Rd, Rn, <operand2> Perform a bitwise logical exclusive or (XOR) operation between
the value in register n and the value specified by <operand2>
and store the result in register d.
MVN Rd, <operand2> Perform a bitwise logical NOT operation on the value specified by
<operand2> and store the result in register d.
LSL Rd, Rn, <operand2> Logically shift left the value stored in register n by the number of
bits specified by <operand2> and store the result in register d.
LSR Rd, Rn, <operand2> Logically shift right the value stored in register n by the number of
bits specified by <operand2> and store the result in register d.
HALT Stops the execution of the program.

Interpretation of <operand2>

<operand2> can be interpreted in two different ways, depending upon whether the first symbol is a
# or an R:
 # - use the decimal value specified after the #, eg #25 means use the decimal value 25.
 Rm - use the value stored in register m, eg R6 means use the value stored in register 6.

The available general purpose registers that the programmer can use are numbered 0 to 12.

Question 6 continues on the next page

Paper 2 V1.21 (FINAL DRAFT) Turn over 


12

Programs written in a high-level language can be compiled or interpreted.

Companies that develop computer programs to sell usually compile the final version of
a program before distributing it to customers.

0 6 . 5 Explain why the final version of a computer program is usually translated using a
compiler.
[2 marks]

The JavaScript programming language can be used to write programs that are
executed in a web browser on any Internet user’s computer.

0 6 . 6 Explain why programs written in the JavaScript language, to be executed in a web


browser, are interpreted rather than compiled.
[2 marks]

Paper 2 V1.21 (FINAL DRAFT)


13

0 7 Figure 5 shows the physical topology of a local area network (LAN) and its connection
to the Internet. The LAN uses the IPv4 protocol.

Figure 5

Subnet Wireless
192.168.0.0 Access
Point

Subnet
Router 1 Switch 192.168.1.0

A Subnet
Router 2 Switch 192.168.2.0

Router and 157.44.12.32


Internet
Firewall

0 7 . 1 State suitable IP addresses for:


[2 marks]

The ‘Router 2’ port labelled A : ________________________

The computer network interface card labelled B : _______________________

0 7 . 2 State one advantage of the star topology over the bus topology, and explain how this
is achieved.
[2 marks]

Question 7 continues on the next page

Paper 2 V1.21 (FINAL DRAFT) Turn over 


14

Laptop computers connect to the network using WiFi. They use carrier sense multiple
access with collision avoidance (CSMA/CA) to determine when to transmit data.

0 7 . 3 Describe how the CSMA/CA method is used.


[6 marks]

Each packet of data transmitted around the LAN includes a checksum, which is used
for error detection.

0 7 . 4 Describe how the checksum is used for error detection.


[3 marks]

13

Paper 2 V1.21 (FINAL DRAFT)


15

0 8 A particular computer uses a normalised floating point representation with an 8-bit


mantissa and a 4-bit exponent, both stored using two’s complement.

Four bit patterns that are stored in this computer’s memory are listed in Figure 6 and
are labelled A, B, C, D. Three of the bit patterns are valid floating point numbers and
one is not.

Figure 6

A 0 1 0 1 1 1 0 0 1 0 1 0
Mantissa Exponent

B 0 0 0 1 1 0 1 0 0 1 0 1
Mantissa Exponent

C 1 0 0 0 0 0 0 0 0 1 1 1
Mantissa Exponent

D 1 0 1 1 1 1 1 1 1 0 0 0
Mantissa Exponent

0 8 . 1 Complete Table 3. In the Correct letter (A-D) column shade the appropriate lozenge
A, B, C or D to indicate which bit pattern in Figure 6 is an example of the type of value
described in the Value description column.

Do not use the same letter more than once.


[3 marks]

Table 3

Value description Correct letter (A-D)


A positive normalised value
A B C D

The most negative value that can be


represented A B C D

A value that is not valid in the


representation because it is not A B C D
normalised

Question 8 continues on the next page

Paper 2 V1.21 (FINAL DRAFT) Turn over 


16

0 8 . 2 The following is a floating point representation of a number:

0 1 0 1 1 0 0 0 0 1 0 1
Mantissa Exponent
Calculate the decimal equivalent of the number. Show how you have arrived at your
answer.
[2 marks]

Answer:

0 8 . 3 Write the normalised floating point representation of the negative decimal value -6.75
in the boxes below. Show how you have arrived at your answer.
[3 marks]

Answer:

Mantissa Exponent

Paper 2 V1.21 (FINAL DRAFT)


17

An alternative two's complement format representation is proposed. In the alternative


representation 6 bits will be used to store the mantissa and 6 bits will be used to store
the exponent.

Existing Representation (8-bit mantissa, 4-bit exponent):

Mantissa Exponent

Proposed Alternative Representation (6-bit mantissa, 6-bit exponent):

Mantissa Exponent

0 8 . 4 Explain the effects of using the proposed alternative representation instead of the
existing representation.
[2 marks]

10

Turn over for the next question

Paper 2 V1.21 (FINAL DRAFT) Turn over 


18

0 9 A school stores information about its sports day in a relational database.

The details of the track events are stored using the three relations in Figure 7.

Figure 7

Athlete (AthleteNumber, Forename, Surname, Class, Gender, DateOfBirth)

Race (RaceNumber, Gender, Distance, Type, StartTime)

RaceEntryAndResult (RaceNumber, AthleteNumber, TimeSet)

Each athlete who takes part in a race is given a unique AthleteNumber. Athletes can
run in more than one race. If they do, they keep the same AthleteNumber for the entire
day.

Many races are run throughout the day. An example race would be the boys 80m
hurdles, the third race of the day, which starts at 13:30. The entry in the Race table for
this race is shown in Table 4:
Table 4

RaceNumber Gender Distance Type StartTime


3 Boys 80 Hurdles 13:30

When an athlete is entered into a race, a record of the entry is created in the
RaceEntryAndResult table. Initially, the TimeSet is recorded as 00:00.00 (meaning
0 minutes, 0 seconds, 0 hundredths of a second) to indicate that the race has not yet
been run. After the race has been run, if the athlete successfully completes it, then
their TimeSet value is updated to record the time that they achieved in minutes,
seconds and hundredths of a second. The TimeSet value remains at 00:00.00 for
athletes who fail to complete the race.

The primary keys in the Athlete and Race relations have been identified in Figure 7 by
underlining them. The correct primary key for the RaceEntryAndResult relation has
not been identified.

0 9 . 1 In Figure 8 below, underline the appropriate attribute name(s) to identify the correct
primary key for this relation.
[1 mark]

Figure 8

RaceEntryAndResult(RaceNumber, AthleteNumber, TimeSet)

Paper 2 V1.21 (FINAL DRAFT)


19

0 9 . 2 Relations in a database should usually be fully normalised.

Define what it means for a database to be fully normalised.


[2 marks]

0 9 . 3 On the incomplete Entity-Relationship diagram below show the degree of the three
relationships that exist between the entities.
[2 marks]

Athlete RaceEntryAndResult

Race

Athlete number 27 is to be entered into race number 6.

0 9 . 4 Write the SQL commands that are required to make this entry.
[2 marks]

Question 9 continues on the next page

Paper 2 V1.21 (FINAL DRAFT) Turn over 


20

Figure 7 is repeated below.

Figure 7 (repeated)

Athlete(AthleteNumber, Forename, Surname, Class, Gender, DateOfBirth)

Race(RaceNumber, Gender, Distance, Type, StartTime)

RaceEntryAndResult(RaceNumber, AthleteNumber, TimeSet)

Athlete number 27 sets a time of 0:18.76 (0 minutes, 18 seconds, 76 hundredths of a


second) for race number 6.

0 9 . 5 Write the SQL commands that are required to update the athlete’s entry for this race,
to store this time in the TimeSet field.
[3 marks]

Paper 2 V1.21 (FINAL DRAFT)


21

The competition organisers want to produce a list of all of the athletes who took part in
race number 6 with the athlete who won (set the lowest time) at the top and the other
athletes below the winner in the order in which they finished.

Only athletes who finished the race should be included in the list.

The following information should appear for each athlete: AthleteNumber, Forename,
Surname and TimeSet.

0 9 . 6 Write an SQL query to produce the list.


[5 marks]

The database system is to be extended for use in an inter-school athletics league.


Users at any school in the county will be able to access the system to input the results
of races.

It is possible that two users might try to access or update the system at the same time.

0 9 . 7 Explain the conditions under which simultaneous access to a database could cause a
problem, and how this could be dealt with.
[3 marks]

18

Paper 2 V1.21 (FINAL DRAFT) Turn over 


22

1 0 Two computers, A and B, are involved in a secure communication that uses


asymmetric encryption. A is sending a message to B.

Each computer has a public key and a private key.

1 0 . 1 Complete the missing words in the following paragraph.


[2 marks]

A will encrypt the message using ____________________ key. The message

will be decrypted by B using ____________________ key.

The security of the communication could be improved by the addition of a digital


signature.

1 0 . 2 State two benefits of including a digital signature.


[2 marks]

Paper 2 V1.21 (FINAL DRAFT)


23

1 1 . 1 Table 5 lists six Boolean equations. Three of them are correct, the others are not.
Shade the lozenges next to the three equations are correct.
[3 marks]
Table 5

Equation Correct? (Shade three)


AA 1

A  B  A B
A  1 1
A  ( A  B)  A
A  ( A  B)  B

A 1  1

1 1 . 2 Use Boolean algebra to simplify the following expression:

A B B A

Show your working.


[3 marks]

Answer:
6

Turn over for the next question

Paper 2 V1.21 (FINAL DRAFT) Turn over 


24

1 2 In a functional programming language, a recursively defined function named map and


a function named double are defined as follows:

map f [] = []
map f (x:xs) = f x : map f xs

double x = 2 * x

The function map has two parameters, a function f, and a list that is either empty
(indicated as []), or non-empty, in which case it is expressed as (x:xs) in which x
is the head and xs is the tail, which is itself a list.

1 2 . 1 In Table 6, write the value(s) that are the head and tail of the list
[ 1, 2, 3, 4 ].
[1 mark]
Table 6

Head

Tail

The result of making the function call double 3 is 6.

1 2 . 2 Calculate the result of making the function call listed in Table 7.


[1 mark]

Table 7

Function Call Result


map double [ 1, 2, 3, 4 ]

1 2 . 3 Explain how you arrived at your answer to question 1 2 . 2 and the recursive
steps that you followed.
[3 marks]

END OF QUESTIONS
5

Paper 2 V1.21 (FINAL DRAFT)


1

A-level
COMPUTER SCIENCE

Paper 2 Additional Questions

IMPORTANT NOTES

These questions focus primarily on topics that were not covered by the AQA AS and A-level
Computing specifications, introduced in 2009. It is hoped that teachers will find questions on these
new topics to be particularly useful.

Many example questions on topics that are common to the new and old specifications can be found
on past papers for COMP1, 2 and 3 on our website. Past papers that are more than three years old
can be accessed via e-AQA.

This document contains additional questions; it is not intended to be treated as a complete paper.
The questions do not provide balance coverage of the specification or the assessment objectives in
the same way that a fully live paper would do.

Version 2.1
15/02/2015

Paper 2 V1.0 (FINAL DRAFT)


Answer all questions in the spaces provided.

0 1 . 1 Four numbers are listed in the rows of Table 1.

For each row in Table 1, shade one or more lozenges, in the appropriate column(s),
to indicate which set(s) of numbers the number on the row is a member of.

As an example, the first row has been completed for you, to indicate that √𝟐 is a
member of the set of irrational numbers and the set of real numbers, but is not a
member of the sets of natural, integer or rational numbers.
[3 marks]

Table 1

Natural Integer Rational Irrational Real


√𝟐

-64

10

5/128

0 1 . 2 Explain the purpose of ordinal numbers.


[1 mark]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 2 . 1 A computer represents numbers using 8-bit two’s complement binary.

Using this representation, perform the decimal calculation 7810 – 2310.

Show all of your working.


[3 marks]

0 2 . 2 Perform the binary calculation 10112 * 1012.

Show all of your working.


[2 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 3 The following value is stored in a byte:

1 0 1 1 0 0 0 1

0 3 . 1 If the byte represents an unsigned binary integer, what is its value in decimal?
[1 mark]

0 3 . 2 If the byte represents a two’s complement binary integer, what is its value in
decimal?
[1 mark]

0 3 . 3 If the byte represents an unsigned fixed point binary number with five bits to the left
of the decimal point and three bits to the right of it, what is its value in decimal?
[1 mark]

0 3 . 4 If the byte represents an unsigned binary integer, what is its value in hexadecimal?
[1 mark]

0 3 . 5 Explain why programmers often prefer to write numbers in hexadecimal instead of


binary.
[1 mark]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 3 . 6 If the byte represents an ASCII character that has been received during a
transmission, with the most significant (leftmost) bit being used as a parity bit and the
odd parity system in use, explain whether or not the character has been received
correctly and how you have determined this.
[2 marks]

0 3 . 7 State two reasons why the Unicode character coding system was introduced as an
alternative to ASCII.
[2 marks]

Reason 1

Reason 2

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 4 Figure 1 shows two alternative architectures for computer systems.

Figure 1
Architecture A Architecture B

Instruction
Memory
Memory

Processor Processor

Data
Memory

0 4 . 1 Identify which of Architecture A or Architecture B is the Harvard architecture by


shading in one lozenge below.
[1 mark]

Harvard architecture is: Architecture A Architecture B

0 4 . 2 Describe one situation that the Harvard architecture is used for, and explain what
advantages the Harvard architecture has over the von Neumann architecture.
[3 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 4 . 3 Figure 2 shows the fetch-execute cycle, excluding how interrupts are dealt with. Some
of the steps in the cycle have been described.

Describe the missing steps 1, 2b and 4 using either register transfer notation or a
written description. Steps 2a and 2b occur at the same time.
[3 marks]

Figure 2

Step 1 ___________________________________________________
1
___________________________________________________

Step 2a PC  [PC] + 1
(Increment contents of Program Counter Register)

2
Step 2b __________________________________________________

__________________________________________________

Step 3: CIR  [MBR]


3 (Transfer contents of Memory Buffer Register into Current
Instruction Register)

Step 4 ___________________________________________________
4
___________________________________________________

5 Step 5 Execute Instruction

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 4 . 4 An interrupt can occur during the fetch-execute cycle.

Explain what happens when an interrupt occurs.


[4 marks]

11

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 5 Figure 3 shows the physical topology of a typical home Local Area Network (LAN) and
its connection to the Internet. The LAN uses the IPv4 protocol.

Figure 3
A

Router Switch
Internet

Combined Device

Device A is a Wireless Access Point. A range of devices, including laptop computers


and mobile phones connect to the network through the Wireless Access Point.

Device B is a Network Attached Storage device which is a server used to store files
that can be accessed by other devices connected to the network.

0 5 . 1 The devices that are used within the home have private IP addresses. The combined
device has both a private IP address and a public IP address.

Explain the differences between private and public IP addresses, and why the
Combined Device has both.
[3 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 5 . 2 The Combined Device performs Network Address Translation (NAT) when a device in
the home communicates with a host on the Internet.

Explain what NAT is and why it is performed.


[3 marks]

0 5 . 3 When purchasing the storage devices to use in the Network Attached Storage device,
a choice had to be made between buying Solid State Drives (SSDs) and traditional
hard disk drives.

Discuss the merits of each of these two types of storage device for this application.
[3 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 5 . 4 Describe the principles of operation of a Solid State Drive (SSD).
[4 marks]

13

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 6 A dynamic web page allows users to search for books in a library so that their details
can be viewed online.

The web page uses the Websocket protocol and is able to update the list of books
found by a query without having to reload the entire page.

The details of the books that the library owns, library members and loans are stored
using the three relations in Figure 4.

Figure 4

Book (BookID, Title, Author, Price, Category, Publisher)

Member (MemberID, Forename, Surname, MaxBooks, DateOfBirth)

Loan (LoanID, BookID, MemberID, DateLoaned, Returned)

0 6 . 1 Write the SQL instructions that are required to create the Member table.
[3 marks]

CREATE TABLE Member (

0 6 . 2 Write an SQL query to retrieve the BookID, Title, Author, Price and Category of all
books written by "David Ferguson" that cost less than £25.00. The books should be
listed in order, with the most expensive book at the top of the list and the cheapest at
the bottom.
[4 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 6 . 3 Which of the four functions of CRUD would the query that you have written in part
0 6 . 2 map to?
[1 mark]

The SQL query from part 0 6 . 2 is executed on the server and finds the
following two records:

BookID Title Author Price Category


10324 The life of a tiger David Ferguson 19.50 Wildlife
16294 Living with lions David Ferguson 12.99 Wildlife

These records could be sent from the server to the client using XML or JSON.

Figure 5 shows the query results encoded using each of these methods.

Figure 5

Representation 1 Representation 2
{"Books":[ <Books>
{ "BookID": 10324, <Book>
"Title": "The life of a tiger", <BookID>10324</BookID>
"Author": "David Ferguson", <Title>The life of a tiger</Title>
"Price": 19.50, <Author>David Ferguson</Author>
"Category": "Wildlife" }, <Price>19.50</Price>
{ "BookID": 16294, <Category>Wildlife</Category>
"Title": "Living with lions", </Book>
"Author": "David Ferguson", <Book>
"Price": 12.99, <BookID>16294</BookID>
"Category": "Wildlife" } <Title>Living with lions</Title>
]} <Author>David Ferguson</Author>
<Price>12.99</Price>
<Category>Wildlife</Category>
</Book>
</Books>

0 6 . 4 Identify which of Representation 1 or Representation 2 is encoded using JSON by


shading in one lozenge below.
[1 mark]

JSON is: Representation 1 Representation 2

0 6 . 5 State two advantages of JSON over XML:


[2 marks]

Advantage 1

Advantage 2

11

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 7 One characteristic of a data set that might result in it being classified as Big Data is
that it contains a very large volume of data.

0 7 . 1 Describe two other characteristics that might also result in a data set being classified
as Big Data.
[2 marks]

Characteristic 1

Characteristic 2

0 7 . 2 Big data is usually processed using parallel or distributed computer architectures.

Explain why functional programming is one appropriate method to use when this is the
case.
[2 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 7 . 3 Big Data can be represented using graph schema. Figure 6 shows part of a graph
schema for employees of a company.

Figure 6
Name:
Name: Claire
John

DOB:
12/4/76 Person ID: 1 Person ID: 2

DOB:
1/10/82

Name:
Ian

Person ID: 3

DOB:
5/8/90

Complete the graph schema to represent the following facts:

a) John and Ian both work for the Finance department.


b) Claire works for the HR department.
c) Ian is John’s manager.
d) John also has the extra role of First Aider.
e) Ian and Claire are married.
[3 marks]
7

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 8 The MOD function calculates the remainder after an integer division has been carried
out.

MOD(x,y) computes the reminder when x is divided by y.

For example, MOD(13,3) = 1 since 13 divided by 3 is 4 remainder 1.

0 8 . 1 What is the co-domain of the MOD function?


[1 mark]

Two functions have been defined:

DOUBLE (x) = 2 * x

SQUARE (x) = x * x

0 8 . 2 State the result of evaluating SQUARE ○ DOUBLE (3).

[1 mark]

0 8 . 3 Explain the purpose of the REDUCE or FOLD function in a functional programming


language.

[2 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
0 9 A group of developers are setting up a cloud storage system that will allow Internet
users worldwide to store their files on servers and share them with other users.

Discuss the ethical, legal and cultural issues that the developers will face when setting
up and running the service.
[9 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
9

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
1 0 Figure 7 shows a message being encrypted using a Caesar cipher.

Figure 7

Wheel settings to use

Plaintext: CROCODILE

Ciphertext: ODAOAPUXQ

1 0 . 1 Decrypt the ciphertext "QXQBTMZF" using the Caesar cipher with the settings shown
in Figure 7.
[1 mark]

1 0 . 2 Using the Vernam cipher method, the plaintext "RUN" is to be encrypted. "RUN" will be
encoded using 8-bit ASCII, according to the ASCII table in Figure 8.

Figure 8

Letter ASCII Code Letter ASCII Code Letter ASCII Code


A 01000001 J 01001010 S 01010011
B 01000010 K 01001011 T 01010100
C 01000011 L 01001100 U 01010101
D 01000100 M 01001101 V 01010110
E 01000101 N 01001110 W 01010111
F 01000110 O 01001111 X 01011000
G 01000111 P 01010000 Y 01011001
H 01001000 Q 01010001 Z 01011010
I 01001001 R 01010010

The key 10111001 01001101 01000001 will be used to perform the encryption.

Perform this encryption, showing how you have worked out what the ciphertext would
be from the plaintext.
[3 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
1 0 . 3 Explain why messages encrypted using a Caesar cipher can be easily cracked, and
why the Vernam cipher is, under certain conditions, considered to be perfectly secure.
[4 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
1 1 The triangle in Figure 9 is repesented as part of an image using vector graphics.

Figure 9

(0,0)

1 1 . 1 The location of the triangle on the screen is represented by storing the co-ordinates of
its three corners.

State two distinct properties, other than the co-ordinates, that could be stored about a
triangle object.
[2 marks]

Property 1

Property 2

1 1 . 2 Discuss the advantages and limitations of vector graphics when compared to the use
of bitmap graphics.
[3 marks]

Paper 2 ADDITIONAL QUESTIONS


v2.1 (FINAL DRAFT)
A-level
COMPUTER SCIENCE
Paper 1

Friday 16 June 2017 Morning Time allowed: 2 hours 30 minutes


Materials
For this paper you must have:
• a computer
• a printer
• appropriate software
• the Electronic Answer Document
• an electronic version and a hard copy of the Skeleton Program
• an electronic version and a hard copy of the Preliminary Material.
You must not use a calculator.

Instructions
• Type the information required on the front of your Electronic Answer Document.
• Before the start of the examination make sure your Centre Number, Candidate Name
and Candidate Number are shown clearly in the footer of every page (not the front cover) of
your Electronic Answer Document.
• Enter your answers into the Electronic Answer Document.
• Answer all questions.
• Save your work at regular intervals.

Information
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100.
• No extra time is allowed for printing and collating.
• The question paper is divided into four sections.

Advice
You are advised to allocate time to each section as follows:
Section A – 45 minutes; Section B – 20 minutes; Section C – 15 minutes; Section D – 70 minutes.

At the end of the examination


Tie together all your printed Electronic Answer Document pages and hand them to the Invigilator.

Warning
It may not be possible to issue a result for this paper if your details are not on every page of your
Electronic Answer Document.

IB/M/Jun17/E5 7517/1
3

Section A

You are advised to spend no longer than 45 minutes on this section.

Type your answers to Section A in your Electronic Answer Document.

You must save this document at regular intervals.

0 1 In a particular programming language, the correct syntax for a real number,


natural number and digit is defined by the syntax diagrams in Figure 1.

Figure 1

0 1 . 1 Write Yes or No in the unshaded cells in Table 1 to identify whether or not the
numbers listed in the table are valid real numbers which conform to the correct
syntax for this language.
[3 marks]
Table 1

Real number Valid? (Yes/No)

87.000

97+12

12.31E+12

Copy the contents of the unshaded cells in Table 1 into the table in your
Electronic Answer document.

0 1 . 2 In Backus-Naur Form (BNF) the following production rule has been written to
define a digit:

<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

Write a BNF production rule to define a natural number that is equivalent to the
definition in the syntax diagram in Figure 1.
[2 marks]
Turn over ►
IB/M/Jun17/7517/1
4

0 2 Postcodes are used to aid the sorting of mail and help to ensure that mail being
sent arrives at the correct destination as quickly as possible.

The format of a UK postcode (ignoring any spaces) is shown in Figure 2.

Figure 2

• 1 or 2 letters
• followed by:
o 1 numeric digit or
o 2 numeric digits or
o 1 numeric digit then 1 letter
• followed by 1 numeric digit
• followed by 2 letters

When a post box is emptied in the town of Ipswich the mail in the post box is
taken to a central sorting office. Each item is looked at and placed in one of three
vans depending upon the postcode written on the envelope.

Postcodes that begin with IP1, IP2, IP3 or IP4 followed by one numeric digit and
two letters, eg IP2 8QY, are for mail being sent to an address in the town of
Ipswich and go in Van A. Other postcodes that begin with IP, eg IP5 3QW, are
for areas not in the town but near to Ipswich and go in Van B. Postcodes that
start with anything other than IP, eg CO3 5FN, are not for the Ipswich area and
go in Van C. IP postcodes do not use the full range of formats available for UK
postcodes.

A finite state machine (FSM) could be used to sort mail using postcodes.
Figure 3 shows a state transition diagram for an FSM used at the Ipswich sorting
office.

In Figure 3, if a transition is not defined from a state for a particular input symbol
then the FSM will stop processing the input and it will be rejected.

0 2 . 1 If the FSM in Figure 3 reaches state S12 what does it mean?


[1 mark]

0 2 . 2 If the FSM in Figure 3 finishes at state S11 what does it mean?


[1 mark]

0 2 . 3 Assuming that the FSM in Figure 3 can be used to recognise any valid
IP postcode, state one format used for UK postcodes that IP postcodes do not
use.
[1 mark]

IB/M/Jun17/7517/1
5

Figure 3

Question 02 continues on the next page

Turn over ►
IB/M/Jun17/7517/1
6

Figure 2 is repeated below.

Figure 2

• 1 or 2 letters
• followed by:
o 1 numeric digit or
o 2 numeric digits or
o 1 numeric digit then 1 letter
• followed by 1 numeric digit
• followed by 2 letters

0 2 . 4 The language recognised by an FSM can also be represented by a regular


expression. When writing regular expressions \d is used to represent any
numeric digit and \a is used to represent any alphabetic character.

For example, the regular expression \d \d \a \d describes the language


of all strings that contain two numeric digits followed by one letter and then
one numeric digit.

Write a regular expression that represents a valid UK postcode as described in


Figure 2. In your answer you should only use the | metacharacter once.
[4 marks]

IB/M/Jun17/7517/1
7

0 3 Table 2 lists some well-known algorithms.

Table 2

Algorithm

Linear search

Merge sort

Binary search

Post-order tree-traversal

0 3 . 1 Which of the algorithms listed in Table 2 has 𝑂(𝑛 log 𝑛) time complexity?
[1 mark]

0 3 . 2 How many of the algorithms listed in Table 2 are algorithms used to solve
tractable problems?
[1 mark]

0 3 . 3 State the time complexity for the bubble sort algorithm in terms of 𝑛, where 𝑛 is
the number of items in the list to be sorted.
[1 mark]

0 3 . 4 Explain why the bubble sort algorithm has the time complexity stated in your
answer to 0 3 . 3
[2 marks]

Turn over for the next question

Turn over ►
IB/M/Jun17/7517/1
8

0 4 Figure 4 shows the data Norbert, Phil, Judith, Mary, Caspar and Tahir entered
into a binary search tree.

Figure 5 contains pseudo-code for a recursive binary tree search algorithm.

Figure 4

Norbert

Judith Phil

Caspar Mary Tahir

Figure 5

FUNCTION TreeSearch(target, node)


OUTPUT 'Visited ', node
IF target = node THEN
RETURN True
ELSE IF target > node AND Exists(node, right) THEN
RETURN TreeSearch(target, node.right)
ELSE IF target < node AND Exists(node, left) THEN
RETURN TreeSearch(target, node.left)
ENDIF
RETURN False
ENDFUNCTION

The subroutine Exists takes two parameters – a node in the binary tree and a
direction (left or right). It returns a Boolean value indicating if the node
given as a parameter has a child node in the direction specified by the second
parameter. For instance, Exists(Mary, left) will return a value of False
as there is no node to the left of Mary in the binary tree.

node.right evaluates to the child node to the right of node,


eg Judith.right is Mary.

node.left evaluates to the child node to the left of node,


eg Judith.left is Caspar.

IB/M/Jun17/7517/1
9

0 4 . 1 What is meant by a recursive subroutine?


[1 mark]

0 4 . 2 There are two base cases for the subroutine TreeSearch. State one of the
base cases.
[1 mark]

0 4 . 3 Complete the unshaded cells of Table 3 to show the result of tracing the
TreeSearch algorithm shown in Figure 5 with the function call
TreeSearch(Olivia, Norbert). You may not need to use all of the
rows.
[3 marks]

Table 3

Function call Output

TreeSearch(Olivia, Norbert)

Copy the contents of the unshaded cells in Table 3 into the table in your
Electronic Answer Document.

Turn over for the next question

Turn over ►
IB/M/Jun17/7517/1
10

0 5 In a simple two-dimensional game the game mechanics are handled by the use of
vectors.

In Figure 6 you can see the current position of the enemy and the hero .

Figure 6

The enemy is currently looking in the direction shown by the vector u in Figure 6.
Vector u can be described as [1, 1].

The vector from the enemy to the hero can be represented by the vector v in
Figure 6. Vector v can be described as [3, –5].

0 5 . 1 Calculate the dot product of u and v.


[1 mark]

IB/M/Jun17/7517/1
11

The hero is going to move.

The current position of the hero can be described by the vector [5, 2].

The movement of the hero can be described by the vector [3, 1].

To process the movement the game updates the screen using the following
operation:

new position = current position vector + movement vector

The dot product can be used to calculate if the enemy can see the hero by using
the algorithm given in Figure 7.

Figure 7

u  [1, 1]
v  [position of hero] - [position of enemy]
IF u.v > 0 THEN
EnemyCanSee  True
ELSE
EnemyCanSee  False
ENDIF

0 5 . 2 Perform vector addition to calculate the new position of the hero.


[1 mark]

0 5 . 3 Complete the unshaded cells of Table 4 to work out if the enemy can see the
hero in this new position.
[3 marks]
Table 4

Calculation Result

u [1, 1]

v = [position of hero] - [position of enemy]

u.v

EnemyCanSee

Copy the contents of the unshaded cells in Table 4 into the table in your
Electronic Answer Document.

Question 05 continues on the next page

Turn over ►
IB/M/Jun17/7517/1
12

Figure 8 shows the scene later on in the game. The route between the enemy
and the hero is blocked by a solid wall indicated by shading.

Figure 8

To move the enemy the game has an algorithm that computes the shortest path
between the enemy and the hero. To find the shortest path it looks at every
possible path between the enemy and the hero.

This algorithm currently struggles to compute the shortest path quickly enough
and it has been suggested that the use of a heuristic technique might help.

0 5 . 4 Explain what is meant by a heuristic technique, giving an example of a heuristic


technique that might reduce the time taken by the shortest path algorithm.
[2 marks]

The data structures used by the game could be static or dynamic.

0 5 . 5 Explain the differences between static and dynamic data structures.


[2 marks]

IB/M/Jun17/7517/1
13

0 6 Two frequently completed actions when using a particular piece of software are
undo and repeat.

The undo action results in the state changing from the current state to the state
previous to the user’s most recent action, eg if the last action the user completed
was to change the font of a selected piece of text from Courier New to Chiller
then if the undo action is selected the result will be to change the font of that text
back to Courier New.

The user is able to keep using the undo action to go back through all previous
states.

The repeat action results in the user’s most recent action being applied again,
eg if the last action the user completed was to change the font of a piece of text to
Chiller then if the repeat action is selected the result will be to change the font of
the currently selected text to Chiller.

The user is able to keep using the repeat action to apply the most recent action
multiple times. The repeat action will only work when there is a most recent
action that can be applied again.

0 6 . 1 Explain how a single stack can be used in the implementation of the repeat action
and the undo action.
[5 marks]

0 6 . 2 State the type of error that occurs if the user tries to complete an undo action
before they have completed any other actions.
[1 mark]

Turn over for Section B

Turn over ►
IB/M/Jun17/7517/1
14

Section B

You are advised to spend no more than 20 minutes on this section.

Enter your answers to Section B in your Electronic Answer Document.


You must save this document at regular intervals.

The question in this section asks you to write program code starting from a new
program/project/file.

You are advised to save your program at regular intervals.

0 7 One method that can be used to compress text data is run length encoding
(RLE). When RLE is used the compressed data can be represented as a set of
character/frequency pairs. When the same character appears in consecutive
locations in the original text it is replaced in the compressed text by a single
instance of the character followed by a number indicating the number of
consecutive instances of that character. Single instances of a character are
represented by the character followed by the number 1.

Figure 9 and Figure 10 show examples of how text would be compressed using
this method.

Figure 9

Original text: AAARRRRGGGHH


Compressed text: A 3 R 4 G 3 H 2

Figure 10

Original text: CUTLASSES


Compressed text: C 1 U 1 T 1 L 1 A 1 S 2 E 1 S 1

What you need to do

Task 1
Write a program that will perform the compression process described above.
The program should display a suitable prompt asking the user to input the text to
compress and then output the compressed text.

Task 2
Test the program works by entering the text AAARRRRGGGHH.

Task 3
Test the program works by entering the text A.

IB/M/Jun17/7517/1
15

Evidence that you need to provide


Include the following in your Electronic Answer Document.

0 7 . 1 Your PROGRAM SOURCE CODE.


[12 marks]

0 7 . 2 SCREEN CAPTURE(S) for the test showing the output of the program when
AAARRRRGGGHH is entered.
[1 mark]

0 7 . 3 SCREEN CAPTURE(S) for the test showing the output of the program when A is
entered.
[1 mark]

Turn over for Section C

Turn over ►
IB/M/Jun17/7517/1
Please write clearly in block capitals.

Centre number Candidate number

Surname

Forename(s)

Candidate signature

A-level
COMPUTER SCIENCE
Paper 2

Thursday 22 June 2017 Morning Time allowed: 2 hours 30 minutes


Materials
For Examiner’s Use
For this paper you must have:
• a calculator. Question Mark

Instructions 01
• Use black ink or black ball-point pen. 02
• Fill in the boxes at the top of this page.
• Answer all questions. 03
• You must answer the questions in the spaces provided. Do not write 04
outside the box around each page or on blank pages.
• Do all rough work in this book. Cross through any work you do not want to 05
be marked.
06
Information 07
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100. 08

Advice 09
• In some questions you are required to indicate your answer by completely 10
shading a lozenge alongside the appropriate answer as shown.
• If you want to change your answer you must cross out your original 11
answer as shown.
• If you wish to return to an answer previously crossed out, ring the answer TOTAL
you now wish to select as shown.

*Jun177517201*
IB/M/Jun17/E4 7517/2
Do not write
2 outside the
box

Answer all questions.

0 1 Figure 1 shows some of the internal components of a processor and how the
processor is connected to the main memory. The internal connections within the
processor are not shown.

Figure 1
Processor Main Memory

PC MAR Address Content


0
1
CIR MBR 2
3
4
5
6
General Purpose 7
Registers

0 1 . 1 Describe how an instruction is fetched from main memory during the fetch stage
of the fetch-execute cycle.

Your description should cover the use of registers and buses, together with the
role of main memory.
[4 marks]

*02*
IB/M/Jun17/7517/2
Do not write
3 outside the
box

0 1 . 2 During the decode and execute stages of the fetch-execute cycle the instruction
that is being processed is stored in the CIR. Explain why the instruction could
not be processed directly from the MBR.
[2 marks]

The computer system shown in Figure 1 uses the von Neumann architecture.
The Harvard architecture is an alternative to this.

0 1 . 3 Explain why the Harvard architecture is sometimes used in preference to the


von Neumann architecture.
[2 marks]

Turn over ►

*03*
IB/M/Jun17/7517/2
Do not write
4 outside the
box

0 2 Figure 2 shows a message being encrypted using a Caesar cipher.

Figure 2

Wheel settings to use

Example

Plaintext: COMPUTER

Ciphertext: IUSVAZKX

0 2 . 1 Decrypt the ciphertext "QGOZRKT" using the Caesar cipher with the settings
shown in Figure 2.
[1 mark]

The Vernam cipher is a more sophisticated cipher system that, under certain
circumstances, offers perfect security.

0 2 . 2 State two conditions that must be met for the Vernam cipher to offer perfect
security.
[2 marks]

Condition 1

Condition 2

*04*
IB/M/Jun17/7517/2
Do not write
5 outside the
box

Both the Caesar and Vernam ciphers are symmetric ciphers, whereas a public
and private key encryption system is an asymmetric cipher system.

0 2 . 3 Explain the difference between a symmetric and an asymmetric cipher system.


[1 mark]

4
Turn over for the next question

Turn over ►

*05*
IB/M/Jun17/7517/2
Do not write
6 outside the
box

0 3 In a particular communications system, eight different voltage levels are used to


encode the value of groups of bits. Each voltage level encodes the value of one
group of bits.

0 3 . 1 Given that eight different voltage levels are used, how many bits can be in a
group that is encoded by a voltage level?
[1 mark]

0 3 . 2 The baud rate for this system is 500 baud.

What is the system’s bit rate?


[1 mark]

Figure 3 shows three suggested relationships between bandwidth and bit rate.

Figure 3

0 3 . 3 Shade one lozenge to indicate which of the lines, A, B or C in Figure 3, shows


the correct relationship between bandwidth and bit rate.
[1 mark]
A B C

*06*
IB/M/Jun17/7517/2
Do not write
7 outside the
box

The system sends the data over a long distance using serial communication.

0 3 . 4 Explain why serial communication is more appropriate in this instance than


parallel communication.
[2 marks]

5
Turn over for the next question

Turn over ►

*07*
IB/M/Jun17/7517/2
Do not write
8 outside the
box

0 4 A computer process, X, can only start executing once processes A and B have
finished executing and either communication channel C or communication
channel D or both are available to use.

The states of processes and communication channels can be read using the
following Boolean variables:

• A is set to TRUE if process A has completed and FALSE if process A is


still running.
• B is set to TRUE if process B has completed and FALSE if process B is
still running.
• C is set to TRUE if communication channel C is available and FALSE if
it is not available.
• D is set to TRUE if communication channel D is available and FALSE if
it is not available.

The Boolean variable X should be set to TRUE if the values of the variables
A, B, C and D indicate that process X can start and to FALSE if they indicate
that process X cannot start yet.

0 4 . 1 In the space below, draw a logic circuit that will represent the logic of the system
described above for the inputs A, B, C and D and the output X.
[3 marks]

0 4 . 2 Write a Boolean expression to represent the logic used to start process X.


[2 marks]

X=

*08*
IB/M/Jun17/7517/2
Do not write
9 outside the
box

0 4 . 3 Using the rules of Boolean algebra, simplify the following Boolean expression.

����������������������������������
�����������������������
� + A ∙ (A + B)� + (B � ∙ C� )
�A

You must show your working.


[4 marks]

Answer

Question 04 continues on the next page

Turn over ►

*09*
IB/M/Jun17/7517/2
Do not write
10 outside the
box

D-type flip-flops can be included in logic circuits.

0 4 . 4 Explain the general purpose of a D-type flip-flop.


[1 mark]

0 4 . 5 One input to a D-type flip-flop is a data signal.

State what the other input to a D-type flip-flop is and what it is used for.
[2 marks]

12

*10*
IB/M/Jun17/7517/2
Do not write
11 outside the
box

0 5 Figure 4 shows the structure of an example machine code instruction, taken from
the instruction set of a particular processor.

Figure 4

Opcode Operand(s)
Basic Machine Addressing
Operation Mode
0 1 1 1 1 0 0 1 0 1 1 1 0 0 1

0 5 . 1 State the purpose of the operand part of an instruction and explain how the
addressing mode is related to this.
[2 marks]

Question 05 continues on the next page

Turn over ►

*11*
IB/M/Jun17/7517/2
Do not write
12 outside the
box

Figure 5 shows an assembly language program together with the contents of a


section of the main memory of the computer that the program will be executed
on. Each main memory location and register can store a 16-bit value.

The assembly language instruction set that has been used to write the program is
listed in Table 1 on the next page.

Figure 5

Program Memory Main Memory


LDR R1, 100 Address Contents
LSL R2, R1, #2 (in decimal) (in decimal)
ADD R1, R1, R2 100 10
LDR R3, 101 101 50
CMP R3, R1 102 80
BEQ labela
MOV R4, #0
B labelb
labela:
MOV R4, #1
labelb:
STR R4, 102
HALT

0 5 . 2 Complete the trace table below, in decimal, to show how the values stored in the
registers and main memory change as the program in Figure 5 is executed. You
may not need to use all of the rows.
[4 marks]

Register Contents Main Memory Location


Contents
R1 R2 R3 R4 100 101 102

0 5 . 3 Explain what the assembly language program in Figure 5 does.


[1 mark]

*12*
IB/M/Jun17/7517/2
Do not write
13 outside the
box

Table 1 – standard AQA assembly language instruction set

LDR Rd, <memory ref> Load the value stored in the memory location specified by
<memory ref> into register d.
STR Rd, <memory ref> Store the value that is in register d into the memory location
specified by <memory ref>.
ADD Rd, Rn, <operand2> Add the value specified in <operand2> to the value in
register n and store the result in register d.
SUB Rd, Rn, <operand2> Subtract the value specified by <operand2> from the value
in register n and store the result in register d.
MOV Rd, <operand2> Copy the value specified by <operand2> into register d.
CMP Rn, <operand2> Compare the value stored in register n with the value
specified by <operand2>.
B <label> Always branch to the instruction at position <label> in the
program.
B<condition> <label> Branch to the instruction at position <label> if the last
comparison met the criterion specified by <condition>.
Possible values for <condition> and their meanings are:
EQ: equal to NE: not equal to
GT: greater than LT: less than
AND Rd, Rn, <operand2> Perform a bitwise logical AND operation between the value
in register n and the value specified by <operand2> and
store the result in register d.
ORR Rd, Rn, <operand2> Perform a bitwise logical OR operation between the value in
register n and the value specified by <operand2> and
store the result in register d.
EOR Rd, Rn, <operand2> Perform a bitwise logical XOR (exclusive or) operation
between the value in register n and the value specified by
<operand2> and store the result in register d.
MVN Rd, <operand2> Perform a bitwise logical NOT operation on the value
specified by <operand2> and store the result in register d.
LSL Rd, Rn, <operand2> Logically shift left the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
LSR Rd, Rn, <operand2> Logically shift right the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
HALT Stops the execution of the program.

Labels: A label is placed in the code by writing an identifier followed by a colon (:). To refer to a
label the identifier of the label is placed after the branch instruction.

Interpretation of <operand2>

<operand2> can be interpreted in two different ways, depending on whether the first character
is a # or an R:

• # – use the decimal value specified after the #, eg #25 means use the decimal value 25.
• Rm – use the value stored in register m, eg R6 means use the value stored in register 6.

The available general purpose registers that the programmer can use are numbered 0 to 12.

Turn over ►

*13*
IB/M/Jun17/7517/2
Do not write
14 outside the
box

0 5 . 4 Discuss the advantages and disadvantages of programming using a high-level


language compared to programming using assembly language.
[4 marks]

11

*14*
IB/M/Jun17/7517/2
Do not write
15 outside the
box

0 6 In a functional programming language a function named square and three lists


a, b and c are defined as follows.

square x = x * x

a = [1, 3, 5]
b = [1, 5, 10, 15]
c = [9, 7, 2]

0 6 . 1 What is the list or value that is the result of applying the functions
head(tail(tail b))?
[1 mark]

0 6 . 2 Calculate the results of making the function calls listed in Table 2 with the lists
a, b and c above.
[3 marks]

Table 2

Function Call Result


map square a

filter (<10) b

fold (+) 0 c

0 6 . 3 map is an example of a higher-order function.

Explain what a higher-order function is.


[1 mark]

Turn over for the next question

Turn over ►

*15*
IB/M/Jun17/7517/2
Do not write
16 outside the
box

0 7 Between 2008 and 2010, a company that was gathering data for an online
mapping system, using cars fitted with cameras and WiFi equipment, collected
some information that was being transmitted on personal WiFi networks. The
company apologised for doing this and an investigation found that a small
number of software developers had been responsible for adding this functionality
to the mapping system data collection software.

In the context of this example, discuss:

• how it was possible for this data to be collected.


• what steps the owners of the networks could have taken to prevent the
data from being collected.
• what legal and ethical issues might have arisen as a result of collecting
this data.
• what lessons the company might have learnt from the incident and how
their practices might have changed as a result of it.

In your answer you will be assessed on your ability to follow a line of reasoning to
produce a coherent, relevant and structured response.
[12 marks]

*16*
IB/M/Jun17/7517/2
Do not write
17 outside the
box

12

Turn over ►

*17*
IB/M/Jun17/7517/2
Do not write
18 outside the
box

0 8 Two methods of representing and playing music on a computer are sampled


sound and MIDI.

Sound is being sampled using a 16-bit sample resolution and a sample rate
of 20 000 Hz.

1 Hz is one sample per second.

0 8 . 1 Calculate the amount of storage space that will be required to store 30 seconds
of recorded sound. Express your answer in kilobytes.

You must show your working.


[2 marks]

Answer

*18*
IB/M/Jun17/7517/2
Do not write
19 outside the
box

0 8 . 2 The highest frequency component in the sound that is being sampled


is 14 500 Hz. The sample rate of 20 000 Hz is not high enough to enable a
faithful reproduction of the original sound from the sample.

Explain why this is the case, justifying your response.


[2 marks]

0 8 . 3 MIDI is a system that can be used to enable musical devices to communicate and
to represent music on a computer.

Explain how MIDI represents music and the advantages of using MIDI for
representing music instead of using sampled sound.
[4 marks]

8
Turn over ►

*19*
IB/M/Jun17/7517/2
Do not write
20 outside the
box

0 9 Figure 6 shows the physical topology of a local area network (LAN) and its
connection to the Internet. The LAN uses the IPv4 protocol.

Figure 6

0 9 . 1 State suitable IP addresses for:


[2 marks]

The 'Router and Firewall' port labelled

The 'Router 2' port labelled

0 9 . 2 Explain the difference between a physical topology and a logical topology.


[2 marks]

*20*
IB/M/Jun17/7517/2
Do not write
21 outside the
box

0 9 . 3 Explain the differences between client-server and peer-to-peer networking.


[4 marks]

8
Turn over for the next question

Turn over ►

*21*
IB/M/Jun17/7517/2
Do not write
22 outside the
box

1 0 A garage services and repairs cars. It uses a relational database to keep track of
the jobs that customers have booked for it to carry out. The database includes
jobs that have been completed and jobs that are waiting to be done.

The details of the jobs that the garage does, together with the parts that it stocks
and uses are stored in the database using the four relations shown in Figure 7.
Figure 7

Job (JobID, CarRegNo, JobDate, InGarage, JobDuration)


Car (CarRegNo, Make, Model, OwnerName, OwnerEmail, OwnerTelNo)
Part (PartID, Description, Price, QuantityInStock)
PartUsedForJob (JobID, PartID, QuantityUsed)

• Each car has a unique CarRegNo.


• A type of car can be uniquely identified by the combination of its Make
and Model. Different Makes may use the same Model name and a
particular manufacturer (Make) will produce several different car Models.
• A booking made for a car on a particular date counts as one job,
regardless of how many different tasks are completed upon it.
• A job might require the use of any number of parts, including zero.
• Some of the details are stored in the database as soon as a booking is
made and others are only added when a job has been completed.

The attribute JobID is the Entity Identifier (Primary Key) of the Job relation.

1 0 . 1 If the JobID attribute were not included in the Job relation, which other attribute or
attributes that are currently in the relation could probably be used as an Entity
Identifier (Primary Key) instead?
[1 mark]

It has been suggested that the owner details (OwnerName, OwnerEmail,


OwnerTelNo) should not be stored in the Car relation and that a new relation
should be created to store owner details separately from car details.

1 0 . 2 Explain why storing the owner details separately would improve the design of the
database.
[2 marks]

*22*
IB/M/Jun17/7517/2
Do not write
23 outside the
box

1 0 . 3 On the incomplete Entity-Relationship diagram below show the degree of


any three relationships that exist between the entities.
[2 marks]

Job Car

Part PartUsedForJob

When an appointment is made for a job, this is represented in the Job relation.
At the time of booking, the InGarage attribute is set to False and the JobDuration
attribute is set to 0:00. When the car arrives at the garage the value of the
InGarage attribute is changed to True. When the job is finished the value of the
JobDuration attribute is updated to indicate how long the job took and details of
the parts used are recorded in the database.

The Job with JobID 206 has been completed. The job took 1 hour 30 minutes
(1:30) and used two of the parts with PartID 12.

1 0 . 4 Write the SQL commands that are required to record the amount of time that the
job took in the database.
[3 marks]

1 0 . 5 Write the SQL commands that are required to record in the database the fact that
two of the parts with PartID 12 were used.
[2 marks]

Turn over ►

*23*
IB/M/Jun17/7517/2
Do not write
24 outside the
box

Figure 7 is repeated below.

Figure 7 (repeated)

Job (JobID, CarRegNo, JobDate, InGarage, JobDuration)


Car (CarRegNo, Make, Model, OwnerName, OwnerEmail, OwnerTelNo)
Part (PartID, Description, Price, QuantityInStock)
PartUsedForJob (JobID, PartID, QuantityUsed)

A mechanic needs to produce a list of all of the parts used on the job with
JobID 93 for a customer.

This list must include the PartID, Description, Price (each) and QuantityUsed of
each part, and no other details. The parts in the list should be ordered by PartID
with the parts with the lowest PartIDs nearest to the top of the list.

1 0 . 6 Write an SQL query to produce the list.


[5 marks]

*24*
IB/M/Jun17/7517/2
Do not write
25 outside the
box

There are restrictions on which parts can be fitted to which cars. For example:

• The driver’s door mirror with PartID 104 can only be fitted to one particular
make and model of car.

• The ignition switch with PartID 27 can be fitted to any model of car for one
particular make as the maker uses the same ignition switch in all models.

• The tyre with PartID 97 can be fitted to a wide range of cars of different
makes and models as it is a standard size.

If the information about which parts could be fitted to which makes and models of
cars were represented in the database, it could be used to help a mechanic
identify the correct parts to use for a job.

1 0 . 7 Explain how the database design could be modified to represent which makes
and models of car a part can be fitted to.
[3 marks]

18
Turn over for the next question

Turn over ►

*25*
IB/M/Jun17/7517/2
Do not write
26 outside the
box

1 1 A particular computer uses a normalised floating point representation with an


8-bit mantissa and a 4-bit exponent, both stored using two’s complement.

Four bit patterns that are stored in this computer’s memory are listed in Figure 8
and are labelled A, B, C and D. Some of the bit patterns are valid normalised
floating point numbers.

Figure 8

A 0 0 0 0 0 0 0 1 0 0 0 0
Mantissa Exponent

B 0 1 0 0 0 0 0 0 1 0 0 0
Mantissa Exponent

C 1 0 0 0 0 0 0 0 0 0 1 0
Mantissa Exponent

D 1 1 0 0 1 1 1 0 1 0 0 0
Mantissa Exponent

1 1 . 1 Shade one lozenge to indicate which bit pattern (A–D) in Figure 8 represents a
negative normalised value.
[1 mark]

A B C D

1 1 . 2 Shade one lozenge to indicate which bit pattern (A–D) in Figure 8 represents the
smallest positive normalised value.
[1 mark]

A B C D

*26*
IB/M/Jun17/7517/2
Do not write
27 outside the
box

1 1 . 3 The following is a floating point representation of a number:

1 0 1 1 0 0 0 0 0 0 1 1
Mantissa Exponent

Calculate the decimal equivalent of the number. You must show your working.
[2 marks]

Answer

1 1 . 4 Write the normalised floating point representation of the decimal value 58.5 in the
boxes below. You must show your working.
[3 marks]

Answer

Mantissa Exponent

Question 11 continues on the next page

Turn over ►

*27*
IB/M/Jun17/7517/2
Do not write
28 outside the
box

There can be a loss of precision when a decimal number is stored when using a
floating point system.

The closest possible representation of the decimal number 13.8 is shown below.

0 1 1 0 1 1 1 0 0 1 0 0
Mantissa Exponent

By converting this bit pattern back into denary it can be seen that the actual
number stored is 13.75, not 13.8.

1 1 . 5 Calculate the absolute error that has occurred.


[1 mark]

Answer

1 1 . 6 Calculate the relative error that has occurred. Express your answer as a
percentage to two decimal places.
[1 mark]

Answer

9
END OF QUESTIONS

Copyright Information

For confidentiality purposes, from the November 2015 examination series, acknowledgements of third party copyright material will be published in a
separate booklet rather than including them on the examination paper or support materials. This booklet is published after each examination series and is
available for free download from www.aqa.org.uk after the live examination series.

Permission to reproduce all copyright material has been applied for. In some cases, efforts to contact copyright-holders may have been unsuccessful and
AQA will be happy to rectify any omissions of acknowledgements. If you have any queries please contact the Copyright Team, AQA, Stag Hill House,
Guildford, GU2 7XJ.

Copyright © 2017 AQA and its licensors. All rights reserved.

*28*
IB/M/Jun17/7517/2
A-level
COMPUTER SCIENCE
Paper 1

Monday 11 June 2018 Morning Time allowed: 2 hours 30 minutes


Materials
For this paper you must have:
• a computer
• a printer
• appropriate software
• the Electronic Answer Document
• an electronic version and a hard copy of the Skeleton Program
• an electronic version and a hard copy of the Preliminary Material
• an electronic version of the Data File aqawords.txt.
You must not use a calculator.

Instructions
• Type the information required on the front of your Electronic Answer Document.
• Before the start of the examination make sure your Centre Number, Candidate Name and
Candidate Number are shown clearly in the footer of every page (also at the top of the front
cover) of your Electronic Answer Document.
• Enter your answers into the Electronic Answer Document.
• Answer all questions.
• Save your work at regular intervals.

Information
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100.
• No extra time is allowed for printing and collating.
• The question paper is divided into four sections.

Advice
You are advised to allocate time to each section as follows:
Section A – 45 minutes; Section B – 20 minutes; Section C – 15 minutes; Section D – 70 minutes.

At the end of the examination


Tie together all your printed Electronic Answer Document pages and hand them to the Invigilator.

Warning
It may not be possible to issue a result for this paper if your details are not on every page of your
Electronic Answer Document.

IB/M/Jun18/E9 7517/1
3

Section A

You are advised to spend no longer than 45 minutes on this section.

Type your answers to Section A in your Electronic Answer Document.

You must save this document at regular intervals.

0 1 There are three boxes containing vegetables. One contains onions, one contains
carrots and one contains onions and carrots. The three boxes have been
labelled. One is labelled "onions", one is labelled "carrots" and the other is
labelled "onions and carrots". You know that all three have been labelled
incorrectly.

0 1 . 1 Describe how you can work out what each box actually contains by taking just
one vegetable out of one box, without looking inside any of the boxes.
[2 marks]

0 2 . 1 How would the infix expression 5 - 3 be represented in Reverse Polish


notation?
[1 mark]

0 2 . 2 How would the infix expression 3 + 4 * 2 - 1 be represented in Reverse


Polish notation?

Use the space below for rough working then copy your answer into your
Electronic Answer Document.
[2 marks]

Question 02 continues on the next page

IB/M/Jun18/7517/1 Turn over ►


4

0 2 . 3 Explain why Reverse Polish notation is sometimes used instead of infix notation.
[2 marks]

0 2 . 4 To evaluate an expression in Reverse Polish notation, you start from the left hand
side of the expression and look at each item until you find an operator
(eg + or -).

This operator is then applied to the two values immediately preceding it in the
expression. The result obtained from this process replaces the operator and the
two values used to calculate it. This process continues until there is only one
value in the expression, which is the final result of the evaluation.

For example 5 2 7 + + would change to 5 9 + after the first replacement.

Explain how a stack could be used in the process of evaluating an expression


in Reverse Polish notation.
[3 marks]

0 2 . 5 Stacks are also used to store a stack frame each time a subroutine call is made.
State two components of a stack frame.
[2 marks]

IB/M/Jun18/7517/1
6

0 3 Figure 1 is a graph that shows the time it takes to travel between six locations in
a warehouse. The six locations have been labelled with the numbers 1 - 6.
When there is no edge between two nodes in the graph this means that it is not
possible to travel directly between those two locations. When there is an edge
between two nodes in the graph the edge is labelled with the time (in minutes) it
takes to travel between the two locations represented by the nodes.

Figure 1
8
1 2 6
2
5
5
3
1 4

3
1

4 5

0 3 . 1 The graph is represented using an adjacency matrix, with the value 0 being used
to indicate that there is no edge between two nodes in the graph.

A value should be written in every cell.

Complete the unshaded cells in Table 1 so that it shows the adjacency matrix for
Figure 1.
Table 1
1 2 3 4 5 6

Copy the contents of the unshaded cells in Table 1 into the table in your
Electronic Answer Document.
[2 marks]

IB/M/Jun18/7517/1
7

0 3 . 2 Instead of using an adjacency matrix, an adjacency list could be used to


represent the graph. Explain the circumstances in which it would be more
appropriate to use an adjacency list instead of an adjacency matrix.
[2 marks]

0 3 . 3 State one reason why the graph shown in Figure 1 is not a tree.
[1 mark]

0 3 . 4 The graph in Figure 1 is a weighted graph. Explain what is meant by a


weighted graph.
[1 mark]

Question 03 continues on the next page

Turn over ►
IB/M/Jun18/7517/1
8

Figure 2 contains pseudo-code for a version of Djikstra’s algorithm used with


the graph in Figure 1.

Q is a priority queue which stores nodes from the graph, maintained in an order
based on the values in array D. The reordering of Q is performed automatically
when a value in D is changed.

AM is the name given to the adjacency matrix for the graph represented in
Figure 1.

Figure 2

Q  empty queue
FOR C1  1 TO 6
D[C1]  20
P[C1]  -1
ADD C1 TO Q
ENDFOR
D[1]  0
WHILE Q NOT EMPTY
U  get next node from Q
remove U from Q
FOR EACH V IN Q WHERE AM[U, V] > 0
A  D[U] + AM[U, V]
IF A < D[V] THEN
D[V]  A
P[V]  U
ENDIF
ENDFOR
ENDFOR
OUTPUT D[6]

0 3 . 5 Complete the unshaded cells of Table 2 to show the result of tracing the
algorithm shown in Figure 2. Some of the trace, including the maintenance of
Q, has already been completed for you.
[7 marks]

IB/M/Jun18/7517/1
9

Table 2

D P
U Q V A 1 2 3 4 5 6 1 2 3 4 5 6
- 1,2,3,4,5,6 - - 20 20 20 20 20 20 -1 -1 -1 -1 -1 -1
0
1 2,3,4,5,6 2
3
4
6
2 3,4,5,6 3
3 4,5,6 6
4 5,6 5
5 6 6
6 -

Copy the contents of the unshaded cells in Table 2 into the table in your
Electronic Answer Document.

0 3 . 6 What does the output from the algorithm in Figure 2 represent?


[1 mark]

0 3 . 7 The contents of the array P were changed by the algorithm. What is the purpose
of the array P?
[2 marks]

Turn over for the next question

Turn over ►
IB/M/Jun18/7517/1
10

0 4 . 1 Describe the Halting problem.


[2 marks]

0 4 . 2 Why is it not possible to create a Turing machine that solves the Halting
problem?
[1 mark]

0 4 . 3 To define a Turing machine the finite alphabet of symbols that it can use needs
to be specified and there needs to be a tape.

State two other components of a Turing machine.


[2 marks]

0 4 . 4 Explain what a Universal Turing Machine is.


[2 marks]

0 4 . 5 Why can a Universal Turing Machine be considered to be more powerful than any
computer that you can purchase?
[1 mark]

IB/M/Jun18/7517/1
11

Section B

You are advised to spend no more than 20 minutes on this section.

Enter your answers to Section B in your Electronic Answer Document.


You must save this document at regular intervals.

The question in this section asks you to write program code starting from a new
program/project/file.

You are advised to save your program at regular intervals.

0 5 Write a program that checks which numbers from a series of numbers entered
by the user are prime numbers.

The program should get a number from the user and then display the messages:

• "Not greater than 1" if the number entered is 1 or less


• "Is prime" if the number entered is a prime number
• "Is not prime" otherwise.

The user should then be asked if they want to enter another number and the program
should repeat if they say that they do.

A prime number is a positive integer that will leave a remainder if it is divided by any
positive integer other than 1 and itself.

You may assume that each number entered by the user is an integer.

If your program only works correctly for some prime numbers you will get some marks
for this question. To get full marks for this question, your program must work correctly
for any valid integer value that the user enters.

Evidence that you need to provide


Include the following in your Electronic Answer Document.

0 5 . 1 Your PROGRAM SOURCE CODE.


[12 marks]

0 5 . 2 SCREEN CAPTURE(S) showing the result of testing the program by:


• entering the number 1
• then choosing to enter another number
• then entering the number 5
• then choosing to enter another number
• then entering the number 8
• and then choosing not to enter another number.

[1 mark]

Turn over ►
IB/M/Jun18/7517/1
Please write clearly in block capitals.

Centre number Candidate number

Surname

Forename(s)

Candidate signature

A-level
COMPUTER SCIENCE
Paper 2

Friday 15 June 2018 Morning Time allowed: 2 hours 30 minutes


Materials For Examiner’s Use
For this paper you must have:
Question Mark
• a calculator.
1
Instructions 2
• Use black ink or black ball-point pen.
3
• Fill in the boxes at the top of this page.
• Answer all questions. 4
• You must answer the questions in the spaces provided. Do not write outside 5
the box around each page or on blank pages. 6
• Do all rough work in this book. Cross through any work you do not want to be
marked. 7
8
Information 9
• The marks for questions are shown in brackets.
10
• The maximum mark for this paper is 100.
11
Advice 12
• In some questions you are required to indicate your answer by completely 13
shading a lozenge alongside the appropriate answer as shown.
• If you want to change your answer you must cross out your original answer as 14
shown. 15
• If you wish to return to an answer previously crossed out, ring the answer
TOTAL
you now wish to select as shown.

*jun187517201*
IB/M/Jun18/E10 7517/2
2

Do not write
Answer all questions. outside the
box

0 1 . 1 Shade one lozenge to indicate which of the unsigned numbers listed in


Table 1 has the largest value.
Table 1

Number Number Largest value


base (shade one)
Binary 101101001

Hexadecimal 30A

Decimal 396
[1 mark]

Questions 01.2 and 01.3 use a normalised floating point representation with a 7-bit
mantissa and a 5-bit exponent, both stored using two’s complement.

The following is a floating point representation of a number:

0 1 0 1 1 0 0 1 1 1 0 1

Mantissa Exponent

0 1 . 2 Calculate the decimal equivalent of the number. You must show your working.

[2 marks]

Answer

*02*
IB/M/Jun18/7517/2
3

Do not write
outside the
0 1 . 3 Write the normalised floating point representation of the decimal value -608 in the box
boxes below. You must show your working.
[3 marks]

Answer
6
Mantissa Exponent

Turn over for the next question

Turn over ►

*03*
IB/M/Jun18/7517/2
4

Do not write
outside the
0 2 Figure 1 shows an image composed of four objects, represented digitally as a vector box
graphic. Figure 2 shows the same image, represented digitally as a bitmap graphic.

The bitmap graphic has an image size of 50 x 50 pixels.

Each image uses four colours: white, black, yellow and blue.

Figure 1 Figure 2

0 2 . 1 Describe how a vector graphic is represented.

Include an explanation of how the black rectangle in Figure 1 would be represented in


your description.

[3 marks]

*04*
IB/M/Jun18/7517/2
5

Do not write
outside the
0 2 . 2 Calculate the minimum amount of storage space that is required to store the bitmap box
image in Figure 2 excluding metadata. Express your answer in bytes.

You must show your working.


[2 marks]

Answer

Figure 3 shows an enlarged view of part of one row of pixels from the image in
Figure 2.

Figure 3

0 2 . 3 Describe how a row of pixels, such as that shown in Figure 3, could be represented in
compressed form by using run length encoding.

[2 marks]

Question 2 continues on the next page

Turn over ►

*05*
IB/M/Jun18/7517/2
6

Do not write
outside the
Figure 4 shows an image of a woodland scene. box

Figure 4

0 2 . 4 The image in Figure 2 is compressed using run length encoding. The compressed file
is 80% smaller than the original file.

The image in Figure 4 is compressed using the same technique and the compressed
file is approximately the same size as the original file.

Explain why the run length encoding method was not able to compress the image in
Figure 4 as much as it could compress the image in Figure 2.
[2 marks]

*06*
IB/M/Jun18/7517/2
7

Do not write
outside the
0 3 Figure 5 shows a logic circuit. box

Figure 5

B H
D
C
F
E

0 3 . 1 Complete the part of the truth table for the circuit in Figure 5 that is shown below.

[3 marks]

Inputs Outputs
A B C D E F G H

0 0 0

0 0 1

0 1 1

1 1 1

0 3 . 2 Using Figure 5, write a Boolean expression to show how the output G is calculated
from the inputs A, B and C.
[3 marks]

G=

0 3 . 3 Explain the purpose of the circuit.


[1 mark]

Turn over ►

*07*
IB/M/Jun18/7517/2
8

Do not write
outside the
0 4 Employees at a bank use client computers to access data that is stored on a box
database server.

The database server uses software to query and modify data stored in a database on
hard disk drives. It returns the results of these queries to the clients over the bank’s
computer network.

The performance of the system is unsatisfactory: the time-delay between a client


sending a query to the server and the client receiving the results is unacceptably
long.

Explain how the performance of the system might be improved. You should consider
the following factors that might be affecting the performance:

• the hardware of the server


• the design of the computer network
• the database and software running on the server.

In your answer you will be assessed on your ability to follow a line of reasoning to
produce a coherent, relevant and structured response.

[12 marks]

*08*
IB/M/Jun18/7517/2
9

Do not write
outside the
box

12

Turn over for the next question

Turn over ►

*09*
IB/M/Jun18/7517/2
10

Do not write
outside the
0 5 Figure 6 shows the physical topology of a local area network (LAN) used by a box
company, and its connection to the Internet. The LAN uses the IPv4 protocol.

Figure 6
Web
Server
Subnet X
Subnet Y

Router Switch
1 A

Subnet Z
Router 2 Switch B

Server

DHCP Server

External 186.12.19.76 Internet


Router

Internally, the network has been divided into subnets: 27 bits have been allocated to
the network/subnet identifier.

0 5 . 1 In binary, write out the subnet mask that has been programmed into the devices on
the network.

[1 mark]

0 5 . 2 Subnet Z consists of all of the devices that are directly connected to Switch B.

What is the maximum number of devices that could be connected to Subnet Z at the
same time?
[1 mark]

*10*
IB/M/Jun18/7517/2
11

Do not write
outside the
0 5 . 3 When a device wishes to join Subnet Z it communicates with the DHCP server. box

Explain:

• the purpose of the DHCP system


• why the DHCP system is used
• what will happen during this communication.
[4 marks]

Question 5 continues on the next page

Turn over ►

*11*
IB/M/Jun18/7517/2
12

Do not write
outside the
0 5 . 4 The web server, which has the IP address 192.168.16.12, must be accessible from box
computers that are connected to the Internet but outside the company’s own network.

As the web server has a non-routable IP address, it cannot be accessed directly from
outside the network. Therefore, access to the web server will be facilitated by the
External Router, which supports Network Address Translation (NAT) and port
forwarding.

Explain how the External Router will have been configured so that the web server can
be accessed by computers outside the network.
[2 marks]

0 6 . 1 Describe the principles of operation of an optical disk drive that is used to read data
from an optical disk such as a CD-ROM or DVD-ROM.
[6 marks]

*12*
IB/M/Jun18/7517/2
13

Do not write
outside the
0 6 . 2 USB Flash Drives (a type of SSD) are a more popular choice for transferring files such box
as images and word processed documents from one computer to another than CD-Rs
(a type of optical disk).

Explain why this is the case.


[1 mark]

0 7 Athletes, who are members of teams, compete in running events, which are held at
fixtures throughout the year.

For example, athlete 15 might compete in the Girls’ 1500m Under 18 race in the
fixture at Marsten on 12 September 2018.

A relational database is used to store the details of which athletes enter each event at
each fixture. The relations used in the database are shown in Figure 7.

Figure 7

Athlete(AthleteID, Surname, Forename, DateOfBirth, Gender, TeamName)


EventType(EventTypeID, Gender, Distance, AgeGroup)
Fixture(FixtureID, FixtureDate, LocationName)
EventAtFixture(FixtureID, EventTypeID)
EventEntry(FixtureID, EventTypeID, AthleteID)

• Each Athlete, EventType and Fixture is identified by a unique identity number, for
example AthleteID for athletes.
• An EventType is a type of event, such as Boys’ 100m Under 15 race.
• If an athlete wants to take part in an event at a particular fixture, then an entry is
created in the EventEntry relation to represent this.

Question 7 continues on the next page

Turn over ►

*13*
IB/M/Jun18/7517/2
14

Do not write
outside the
0 7 . 1 Figure 8 shows an incomplete entity-relationship diagram for part of the database. box

Draw lines on Figure 8 to show the degree of any three relationships that exist
between the four entities shown.
[2 marks]
Figure 8

EventType Fixture

EventEntry EventAtFixture

0 7 . 2 Figure 9 shows an SQL statement that is intended to make a table to represent the
Athlete relation. The statement contains some errors.

Figure 9

CREATE TABLE Athlete (


PRIMARY KEY AthleteID,
VARCHAR(50) Surname,
VARCHAR(30) Forename,
DATE DateOfBirth,
VARCHAR(6) Gender,
VARCHAR(30) TeamName
)

You may assume that all of the data types used in Figure 9 are valid and the field
lengths are appropriate.

State two errors that have been made.

[2 marks]

Error 1:

Error 2:

*14*
IB/M/Jun18/7517/2
15

Do not write
outside the
0 7 . 3 State two reasons why database designs, such as this one, are usually normalised. box

[2 marks]

Reason 1:

Reason 2:

Figure 7 is repeated below.

Figure 7 (repeated)

Athlete(AthleteID, Surname, Forename, DateOfBirth, Gender, TeamName)


EventType(EventTypeID, Gender, Distance, AgeGroup)
Fixture(FixtureID, FixtureDate, LocationName)
EventAtFixture(FixtureID, EventTypeID)
EventEntry(FixtureID, EventTypeID, AthleteID)

A list is to be produced of the names of all athletes who are competing in the fixture
that is taking place on 17/09/18. The list must include the Surname, Forename and
DateOfBirth of these athletes and no other details. The list should be presented in
alphabetical order by Surname.

0 7 . 4 Write an SQL query to produce the list.


[5 marks]

11

Turn over ►

*15*
IB/M/Jun18/7517/2
16

Do not write
outside the
0 8 Explain some of the challenges that face legislators in the digital age. box
[3 marks]

0 9 . 1 Three numbers are listed in the first column of Table 2.

For each row in Table 2, shade one or more lozenges, in the appropriate column(s),
to indicate which set(s) of numbers contain(s) the number on the row.

As an example, the first row has been completed for you, to indicate that 𝝅𝝅 is a
member of the set of irrational numbers and the set of real numbers, but is not a
member of the sets of natural, integer or rational numbers.
[2 marks]
Table 2

Natural Integer Rational Irrational Real

𝝅𝝅

15/23

108

*16*
IB/M/Jun18/7517/2
17

Do not write
outside the
0 9 . 2 Figure 10 shows a list of eight numbers, stored in an array. box

Figure 10

Index [0] [1] [2] [3] [4] [5] [6] [7]

Contents 48 9 201 62 82 92 30 72

Describe what an ordinal number is and what an ordinal number would be used for in
the context of this array.
[2 marks]

1 0 Using the laws of Boolean algebra, show that:

� )� = A ∙ C + B
(A + B) ∙ �B + C ∙ (D + D

You must show your working.


[4 marks]

Turn over for the next question

Turn over ►

*17*
IB/M/Jun18/7517/2
18

Do not write
outside the
1 1 Figure 11 shows an analogue signal represented as a waveform. The analogue box
signal is being converted to a digital signal by an analogue to digital convertor (ADC).

Figure 11

Points A and B in Figure 11 indicate the amplitude of the waveform (A), at a point in
time, and the value that was recorded for this measurement when the waveform was
sampled (B).

1 1 . 1 The waveform’s amplitude is measured and recorded using a scale with 16 divisions,
which are shown on the Y axis in Figure 11.

The recorded digital data indicates which division on the Y axis each measurement is
closest to. For example, the closest division to measurement A is 13.

What sample resolution has been used?


[1 mark]

1 1 . 2 The graph covers a time period of 0.01 seconds. During this time period, 10 samples
have been recorded at the times indicated by the divisions on the X axis in Figure 11.

What sample rate has been used?


[1 mark]

*18*
IB/M/Jun18/7517/2
19

Do not write
outside the
1 1 . 3 Explain the impact of the difference between A and B and how this difference could box
be reduced by redesigning the sampling system.
[2 marks]

1 1 . 4 A different analogue signal is being sampled. The highest frequency present in the
signal’s waveform is 1200 Hz.

What is the minimum sample rate that must be used during sampling in order to
preserve all of the frequencies in the waveform?
[1 mark]

Turn over for the next question

Turn over ►

*19*
IB/M/Jun18/7517/2
20

Do not write
outside the
1 2 The pseudo-code in Figure 12 shows one method for carrying out encryption of a box
single character using the Caesar Cipher.

If the character to be encrypted is a capital letter, then the encrypted character will be
shifted along the alphabet by the number of positions specified by the key. If the
character is not a capital letter, then the encrypted character is set to be equal to the
original character.

The pseudo-code assumes that the letter to encrypt is stored using the Unicode
UTF-8 encoding method, for which the values of capital letters (in decimal) are shown
in Table 3.

Figure 12

IF characterCode >= 65 AND characterCode <= 90 THEN


encryptedCode  characterCode + keyValue
IF encryptedCode > 90 THEN
encryptedCode  encryptedCode – 26
ENDIF
ELSE
encryptedCode  characterCode
ENDIF

Table 3

A 65 N 78
B 66 O 79
C 67 P 80
D 68 Q 81
E 69 R 82
F 70 S 83
G 71 T 84
H 72 U 85
I 73 V 86
J 74 W 87
K 75 X 88
L 76 Y 89
M 77 Z 90

Figure 13 shows an incomplete assembly language program that has been written to
implement the pseudo-code algorithm shown in Figure 12. The assembly language
instruction set that has been used to write the program is listed in Table 4 on
page 22.

The symbols  and  indicate the positions of missing lines of code.

*20*
IB/M/Jun18/7517/2
21

Do not write
outside the
Figure 13 box

CMP R1, #65


BLT doNotEncrypt
CMP R1, #90
BGT doNotEncrypt
ADD R3, R1, R2

doNotEncrypt:

finished:
HALT

1 2 . 1 By analysing the assembly language program in Figure 13, explain the purpose for
which the registers R1, R2 and R3 have been used.
[2 marks]

Register Purpose

R1

R2

R3

1 2 . 2 On Figure 13, write the assembly language instruction that is missing from
position .
[1 mark]

1 2 . 3 On Figure 13, write the assembly language instructions that are missing from
position .
6
[3 marks]

Turn to page 23 for the next question

Turn over ►

*21*
IB/M/Jun18/7517/2
22

Do not write
outside the
Table 4 – Standard AQA assembly language instruction set box

LDR Rd, <memory ref> Load the value stored in the memory location specified by
<memory ref> into register d.
STR Rd, <memory ref> Store the value that is in register d into the memory location
specified by <memory ref>.
ADD Rd, Rn, <operand2> Add the value specified in <operand2> to the value in
register n and store the result in register d.
SUB Rd, Rn, <operand2> Subtract the value specified by <operand2> from the value
in register n and store the result in register d.
MOV Rd, <operand2> Copy the value specified by <operand2> into register d.
CMP Rn, <operand2> Compare the value stored in register n with the value
specified by <operand2>.
B <label> Always branch to the instruction at position <label> in the
program.
B<condition> <label> Branch to the instruction at position <label> if the last
comparison met the criterion specified by <condition>.
Possible values for <condition> and their meanings are:
EQ: equal to NE: not equal to
GT: greater than LT: less than
AND Rd, Rn, <operand2> Perform a bitwise logical AND operation between the value
in register n and the value specified by <operand2> and
store the result in register d.
ORR Rd, Rn, <operand2> Perform a bitwise logical OR operation between the value in
register n and the value specified by <operand2> and
store the result in register d.
EOR Rd, Rn, <operand2> Perform a bitwise logical XOR (exclusive or) operation
between the value in register n and the value specified by
<operand2> and store the result in register d.
MVN Rd, <operand2> Perform a bitwise logical NOT operation on the value
specified by <operand2> and store the result in register d.
LSL Rd, Rn, <operand2> Logically shift left the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
LSR Rd, Rn, <operand2> Logically shift right the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
HALT Stops the execution of the program.

Labels: A label is placed in the code by writing an identifier followed by a colon (:). To refer to a
label, the identifier of the label is placed after the branch instruction.

Interpretation of <operand2>

<operand2> can be interpreted in two different ways, depending on whether the first character
is a # or an R:

• # – use the decimal value specified after the #, eg #25 means use the decimal value 25.
• Rm – use the value stored in register m, eg R6 means use the value stored in register 6.

The available general purpose registers that the programmer can use are numbered 0 to 12.

*22*
IB/M/Jun18/7517/2
23

Do not write
outside the
1 3 A family uses a wireless computer network at home. box

1 3 . 1 Describe two security measures that the family should put in place to ensure that the
wireless access point is secure and explain how these security measures will make
wireless connections to the access point more secure.
[2 marks]

Measure 1:

Measure 2:

Question 13 continues on the next page

Turn over ►

*23*
IB/M/Jun18/7517/2
24

Do not write
outside the
1 3 . 2 The network uses the CSMA/CA access method with Request to Send/Clear to Send box
(RTS/CTS).

A computer on the network has data to send to another computer. Explain how the
CSMA/CA access method with RTS/CTS will be used during this transmission.

[6 marks]

1 4 . 1 One characteristic of a data set that might result in it being classified as Big Data is
that it contains a variety of different forms of information.

Describe two other characteristics that might result in a data set being classified as
Big Data.
[2 marks]

Characteristic 1:

Characteristic 2:

*24*
IB/M/Jun18/7517/2
25

Do not write
outside the
1 4 . 2 In a fact-based model, data is represented as atomic facts, which are immutable box
(ie will never change). Fact-based models can be represented visually using a graph
schema.

Figure 14 shows part of a graph schema for a data set about deliveries made to
stores by trucks.

Figure 14

Store: Store:
Manchester Birmingham

Delivered_To Delivered_To

Refrigerated: Refrigerated:
Yes No

Truck: Truck:
MJ15HWE PT63JTR

Store:
Sheffield

Complete the graph schema in Figure 14 to represent the following additional facts.

• Truck MJ15HWE has made a delivery to the Sheffield store.

• Truck PT63JTR was last serviced on 10 May 2018 and truck MJ15HWE was
last serviced on 18 March 2018.

• Both of the trucks are owned by a haulage company called Ferguson’s which
has 15 employees and has a head office in Bolton.

[3 marks]
5

Turn over for the next question

Turn over ►

*25*
IB/M/Jun18/7517/2
26

Do not write
outside the
1 5 In a functional programming language, four functions named fw, fx, fy and fz and box
a list named sales are defined as shown in Figure 15.

Figure 15

fw [a,b] = a * b
fx c = map fw c
fy d = fold (+) 0 d
fz e = fy (fx e)

sales = [[10,2], [2,25], [4,8]]

The sales list represents all of the sales made in a shop in 1 day. It is composed of
sublists.

The values in each sublist indicate the price of a product and the quantity of the
product that was sold. For example, [10,2] indicates that 10 units of a product
priced at £2 were sold.

1 5 . 1 Shade one lozenge to indicate how many of the four functions (fw, fx, fy, fz) in
Figure 15 use a higher-order function.
[1 mark]

1 2 3 4

1 5 . 2 Calculate the results of making the function calls listed in Table 5, using the functions
and lists in Figure 15 as appropriate.
[3 marks]

Table 5

Function call Result

fw [4,3]

fx sales

fz sales

*26*
IB/M/Jun18/7517/2
27

Do not write
1 5 . 3 In the context of the shop, explain what the result of the function call fz sales outside the
box
represents.
[1 mark]

END OF QUESTIONS

*27*
IB/M/Jun18/7517/2
A-level
COMPUTER SCIENCE
Paper 1

Monday 3 June 2019 Morning Time allowed: 2 hours 30 minutes


Materials
For this paper you must have:
• a computer
• a printer
• appropriate software
• the Electronic Answer Document
• an electronic version and a hard copy of the Skeleton Program
• an electronic version and a hard copy of the Preliminary Material
• an electronic version of the Data Files flag1.gme and flag2.gme.
You must not use a calculator.

Instructions
• Type the information required on the front of your Electronic Answer Document.
• Before the start of the examination make sure your Centre Number, Candidate Name and
Candidate Number are shown clearly in the footer of every page (also at the top of the front
cover) of your Electronic Answer Document.
• Enter your answers into the Electronic Answer Document.
• Answer all questions.
• Save your work at regular intervals.

Information
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100.
• No extra time is allowed for printing and collating.
• The question paper is divided into four sections.

Advice
You are advised to allocate time to each section as follows:
Section A – 45 minutes; Section B – 20 minutes; Section C – 15 minutes; Section D – 70 minutes.

At the end of the examination


Tie together all your printed Electronic Answer Document pages and hand them to the Invigilator.

Warning
It may not be possible to issue a result for this paper if your details are not on every page of your
Electronic Answer Document.

IB/M/Jun19/7517/1/E7 7517/1
2

Section A

You are advised to spend no longer than 45 minutes on this section.

Type your answers to Section A in your Electronic Answer Document.

You must save this document at regular intervals.

0 1 Figure 1 shows a bubble sort algorithm represented using pseudo-code. The


algorithm sorts the data in a list L.

Figure 1

PROCEDURE BubbleSort(L)
N  LEN(L) – 2
Count1  0
WHILE Count1 < LEN(L) – 1
FOR Count2  0 TO N
IF L[Count2] > L[Count2 + 1] THEN
Temp  L[Count2]
L[Count2]  L[Count2 + 1]
L[Count2 + 1]  Temp
ENDIF
ENDFOR
Count1  Count1 + 1
ENDWHILE
ENDPROCEDURE

0 1 . 1 Describe two changes that could be made to this bubble sort algorithm that
would be likely to result in fewer comparisons being made when sorting the list
L. The algorithm should still be a bubble sort algorithm if your suggested
changes were made.
[4 marks]

0 1 . 2 ‘Sorting a list becomes an intractable problem when the size of the list is very
large; it is a tractable problem when the size of the list is small.’

Explain why this statement is wrong.


[2 marks]

0 1 . 3 Explain what approach(es) a programmer might take if asked to ‘solve’ an


intractable problem.
[2 marks]

IB/M/Jun19/7517/1
3

There are no questions printed on this page

Turn over for the next question

IB/M/Jun19/7517/1 Turn over ►


4

0 2 Figure 2 shows the transition function (represented as a state transition diagram) and
part of the tape for a Turing machine designed to complete a task. The current
position of the read/write head is indicated by the * symbol.

Figure 2

... 0 1* 1 0 0 0 0 ...

The label 1|# on the transition from S0 to S1 means if the machine is in state S0
and a 1 is read from the tape then a # should be written to the tape and then the
read/write head moved one cell to the right.

0 2 . 1 After four steps of the computation have been completed, the current state, the tape
contents and the position of the read/write head are:

Tape Current
state
... 0 # 1 0* 1 0 0 ... S3

Complete the unshaded cells of Table 1 to show the result of tracing the computation
of this Turing machine, from step five onwards. Show the contents of the tape, the
current position of the read/write head and the current state as the input symbols are
processed. Step four has been repeated at the start of the trace.

IB/M/Jun19/7517/1
5

Table 1

Tape Current
state
... 0 # 1 0* 1 0 0 ... S3
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...

Copy the contents of the unshaded cells in Table 1 into the table in your Electronic
Answer Document.
[5 marks]

0 2 . 2 What is the purpose of the Turing machine shown in Figure 2?


[1 mark]

0 2 . 3 What is the purpose of the transition from S5 to S6 in the Turing machine in


Figure 2?
[1 mark]

0 2 . 4 Explain what a Universal Turing machine is.


[2 marks]

Turn over for the next question

IB/M/Jun19/7517/1 Turn over ►


6

0 3 Figure 3 shows a partial solution to a logic puzzle. To complete the solution each of
the letters A-I must appear exactly once in each row of nine cells, exactly once in
each column of nine cells and exactly once in each of the collections of three-by-three
cells shown with limits shown by a thicker border.

In Figure 3 the logic puzzle has been completed except for the collection of three-by-
three cells in the top-right corner.

Figure 3

D F G B A C
I E H F G D
A B C I H E

B G D E C H A F I
F H I D B A E G C
C A E G I F B H D

H D B C E G F I A
G C F A D I H B E
E I A H F B D C G

0 3 . 1 Complete the solution for the puzzle shown in Figure 3.

Copy the contents of the unshaded cells in Figure 3 into the table in your Electronic
Answer Document.
[1 mark]

Figure 4 shows a simpler example of this type of logic puzzle with fewer cells. In this
simpler puzzle only the letters A-D are used.

Figure 4

C B
A

B
A

It is possible to represent this type of puzzle as a graph. To do this a unique number


is given to each cell and a node containing this unique number is added to the graph.
An edge between two nodes denotes a link between those two cells, meaning they
cannot contain the same letter as each other.

Figure 5 shows how unique numbers have been allocated to each cell in the puzzle in
Figure 4 and Figure 6 shows an adjacency matrix that represents this puzzle.

IB/M/Jun19/7517/1
7

Figure 5

0 1 2 3

4 5 6 7

8 9 10 11

12 13 14 15

Figure 6

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

0 1 1 1 1 1 0 0 1 0 0 0 1 0 0 0

1 1 1 1 1 0 0 0 1 0 0 0 1 0 0

2 1 0 0 1 1 0 0 1 0 0 0 1 0

3 0 0 1 1 0 0 0 1 0 0 0 1

4 1 1 1 1 0 0 0 1 0 0 0

5 1 1 0 1 0 0 0 1 0 0

6 1 0 0 1 0 0 0 1 0

7 0 0 0 1 0 0 0 1

8 1 1 1 1 1 0 0

9 1 1 1 1 0 0

10 1 0 0 1 1

11 0 0 1 1

12 1 1 1

13 1 1

14 1

15

The graph in Figure 6 can be considered to be both a representational abstraction


and an abstraction by generalisation of the puzzle from Figure 4.

Question 3 continues on the next page

IB/M/Jun19/7517/1 Turn over ►


8

0 3 . 2 What is representational abstraction?


[1 mark]

0 3 . 3 What is abstraction by generalisation?


[1 mark]

0 3 . 4 Other than the contents of the cells, what information has been removed from the
puzzle in Figure 4 when it has been represented as a graph?
[1 mark]

A graph can be represented using an adjacency list or as an adjacency matrix.

0 3 . 5 Explain the circumstances when it would be more appropriate to use an adjacency


matrix instead of an adjacency list.
[2 marks]

0 3 . 6 Only the top half of the matrix in Figure 6 needed to be used to present the puzzle.
For which type of graph would the bottom half of the matrix also need to be used?
[1 mark]

0 4

0 4 . 1 Explain the functionality of the * metacharacter when it is used in a


regular expression.
[1 mark]

0 4 . 2 Explain the functionality of the ? metacharacter when it is used in a regular


expression.
[1 mark]

0 4 . 3 Complete Table 2 to show which of the strings belong to the language defined by the
regular expression 1|01+.

Table 2

String Belongs to language (Y/N)?


1
11
01
0111
0101
111
0011

Copy the contents of the unshaded cells in Table 2 into the table in your Electronic
Answer Document.
[3 marks]

IB/M/Jun19/7517/1
9

Section B

You are advised to spend no more than 20 minutes on this section.

Enter your answers to Section B in your Electronic Answer Document.


You must save this document at regular intervals.

The question in this section asks you to write program code


starting from a new program/project/file.

You are advised to save your program at regular intervals.

0 5 Write a program that gets two words from the user and then displays a message
saying if the first word can be created using the letters from the second word or not.

For example:

• The word EAT can be formed from the word ATE as the first word uses one E, one
A and one T and the second word also contains one of each of these letters.

• The word EAT can be formed from the word HEART as the second word contains
one E, one A and one T which are the letters needed to form the first word.

• The word TO can be formed from the word POSITION as the second word contains
one T and (at least) one O which are the letters needed to form the first word.

• The word MEET cannot be formed from the word MEAT as the second word only
contains one E and two Es are needed to form the first word.

You may assume that the user will only enter words that consist of upper case letters.

Evidence that you need to provide


Include the following evidence in your Electronic Answer Document.

0 5 . 1 Your PROGRAM SOURCE CODE.


[12 marks]

0 5 . 2 SCREEN CAPTURE(S) showing the result of testing the program by entering:

• the word NINE followed by the word ELEPHANTINE.


• the word NINE followed by the word ELEPHANT.

[1 mark]

Turn over for Section C

IB/M/Jun19/7517/1 Turn over ►


Please write clearly in block capitals.

Centre number Candidate number

Surname

Forename(s)

Candidate signature

A-level
COMPUTER SCIENCE
Paper 2

Tuesday 11 June 2019 Morning Time allowed: 2 hours 30 minutes


Materials
For this paper you must have: For Examiner’s Use
• a calculator.
Question Mark

Instructions 1
• Use black ink or black ball-point pen. 2
• Fill in the boxes at the top of this page. 3
• Answer all questions.
• You must answer the questions in the spaces provided. Do not write outside 4
the box around each page or on blank pages. 5
• Do all rough work in this book. Cross through any work you do not want to be 6
marked.
7

Information 8
• The marks for questions are shown in brackets. 9
• The maximum mark for this paper is 100.
10

Advice 11
• In some questions you are required to indicate your answer by completely 12
shading a lozenge alongside the appropriate answer as shown. 13
• If you want to change your answer you must cross out your original answer as
14
shown.
• If you wish to return to an answer previously crossed out, ring the answer TOTAL
you now wish to select as shown.

*jun197517201*
IB/M/Jun19/E14 7517/2
2

Do
Donot
notwrite
write
outside
outsidethethe
Answer all questions. box
box

0 1 . 1 Shade one lozenge to indicate to which category of system software a virus


checker belongs.
[1 mark]

Category Shade one lozenge


Operating systems
Translators
Utilities

0 1 . 2 The operating system is responsible for resource management.

Describe two different types of resource management that an operating system is


responsible for.
[2 marks]

Type 1:

Type 2:

*02*
IB/M/Jun19/7517/2
3
Do not write
outside the
0 2 . 1 A company is setting up a computer network to help manage its business. box

The company sets up a computer that will act as a server. The server’s primary role
will be to act as an email server. It will also allow technicians to remotely login so that
the server can be managed from other computers.

State the names of two application layer protocols that the server must implement
and explain what each will be used for.
[4 marks]

Protocol 1:

Use:

Protocol 2:

Use:

0 2 . 2 Explain how the transport layer of the TCP/IP stack determines which application
layer software on the server should deal with a received request.
[1 mark]

0 2 . 3 Describe one function of the network layer of the TCP/IP stack.


[1 mark]

Turn over for the next question

Turn over ►

*03*
IB/M/Jun19/7517/2
4
Do not write
outside the
0 3 The paragraph of text in Figure 1 is to be compressed using a dictionary-based box
compression method.

Figure 1

Unfortunately time after time it is the case that programmers fail to put
enough effort into commenting their code. Effort put into commenting
could make the code easier to maintain when the time comes to do
this.

0 3 . 1 Dictionary-based compression is an example of a lossless encryption method.

Explain the key difference between lossless and lossy compression methods.
[1 mark]

0 3 . 2 Explain how the paragraph of text in Figure 1 could be compressed using a


dictionary-based method.
[2 marks]

0 3 . 3 After the text in Figure 1 has been compressed it is to be transmitted across a


computer network.

Explain why dictionary-based compression is not very effective for compressing small
amounts of text for transmission.
[1 mark]

*04*
IB/M/Jun19/7517/2
5
Do not write
outside the
0 4 A student has attempted to add together the binary numbers 00110011 and box

10110110, but has made a mistake.

The student’s calculation is shown in Figure 2 below.

Figure 2

A B C D E F G H
0 0 1 1 0 0 1 1
+ 1 0 1 1 0 1 1 0
Carry 0 1 1 0 1 1 0
Result 1 1 0 0 1 0 0 1

Explain what mistake the student has made.

The columns in the addition have been labelled A to H to help you make your
explanation clear.
[1 mark]

0 5 A student has written a computer program using an imperative high-level


programming language. The program could be translated using either a compiler or
an interpreter.

Describe the steps that must be completed to translate and execute the program.

Your description should include:

• why translation is necessary


• the differences between how a compiler and an interpreter would translate the
program
• how the machine code instructions that are used to carry out the program will be
fetched and executed by the processor from main memory.
[12 marks]

Turn over ►

*05*
IB/M/Jun19/7517/2
6
Do not write
outside the
box

*06*
IB/M/Jun19/7517/2
7
Do not write
outside the
box

12

Turn over for the next question

Turn over ►

*07*
IB/M/Jun19/7517/2
8
Do not write
outside the
0 6 A veterinary practice with four different surgeries intends to use a relational database box
to store the data that it needs to manage its business.

Customers of the practice are pet owners who bring their pets to one of the surgeries
for appointments. The surgeries are staffed by vets.

• Each customer is identified by a unique identity number and the customer’s


forename, surname and telephone number are recorded.

• Each pet is identified by a unique identity number and the pet’s name, type and
date of birth are recorded.

• Each surgery is identified uniquely by its name. The town in which it is located and
the surgery’s telephone number are recorded.

• Each vet is identified by a unique identity number and the vet’s forename and
surname are recorded.

A pet is owned by one or more customers and each customer may own any number
of pets. Over their lifetimes, pets may attend many appointments.

To make an appointment for a pet, a customer contacts a surgery. The appointment is


made for the pet to take place on a particular date and time at a specific surgery.

Each vet is associated with one surgery which they work at; each surgery is staffed by
several vets.

0 6 . 1 Complete the entity-relationship diagram below for a fully normalised relational


database to store the data required by the veterinary practice.

Some of the entities and relationships have been drawn for you. You need to draw the
remaining three entities and clearly show the relationships between the entities and
their degree.
[3 marks]

*08*
IB/M/Jun19/7517/2
9
Do not write
outside the
0 6 . 2 Develop a fully normalised design for a relational database to store the information box

required by the veterinary practice. To help you, the Pet, Surgery and Vet relations
have already been defined in Figure 3.

Figure 3

Pet(PetID, PetName, Type, DateOfBirth)


Surgery(SurgeryName, Town, TelephoneNumber)
Vet(VetID, VetForename, VetSurname, SurgeryName)

Using the format shown in Figure 3 list all the other relations that will need to be
created, together with the attributes that each will contain.

Underline the attribute(s) that will form the entity identifier (primary key) in
each relation.
[4 marks]

Question 6 continues on the next page

Turn over ►

*09*
IB/M/Jun19/7517/2
10
Do not write
outside the
0 6 . 3 The SQL query in Figure 4 has been written to produce a list of all of the vets who box
work at the surgery in the town of Torquay. Some errors have been made in
the query.

Figure 4

SELECT VetForename, VetSurname


FROM Surgery, Vet
WHERE Town = Torquay

Describe two errors that have been made in the query. You should not give the
omission of a semi-colon (;) as one of the errors.
[2 marks]

Error 1:

Error 2:

0 6 . 4 The database is stored at the practice’s head office. Staff at the individual surgeries
access it using a client-server database system, which enables the management of
concurrent access to the database.

Describe an example of a problem that could occur if no system were in place to


manage concurrent access to the database.
[3 marks]

*10*
IB/M/Jun19/7517/2
11
Do not write
outside the
0 6 . 5 Two methods that can be used to manage concurrent access are: box

• record locks
• timestamp ordering.

Select one of these methods and describe how it manages concurrent access.
[2 marks]

Method selected:

How it works:

14

Turn over for the next question

Turn over ►

*11*
IB/M/Jun19/7517/2
12
Do not write
outside the
0 7 Figure 5 shows three commonly used mathematical functions: add, square and box

pred.

Figure 5

add(x,y) = x + y

square(x) = x2

pred(x) = x - 1

For example:

• add(3,2) evaluates to 5
• square(2) evaluates to 4
• pred(8) evaluates to 7

The domain of the functions square and pred in Figure 5 is the set of integers ℤ
and the domain of the add function is ℤ × ℤ.

0 7 . 1 What is the co-domain of the pred function?


[1 mark]

0 7 . 2 What is the result of applying square ° pred to the argument 3?


[1 mark]

0 7 . 3 The add function takes two arguments.

Describe how the add function could be partially applied to the arguments 4 and 6.
[3 marks]

*12*
IB/M/Jun19/7517/2
13
Do not write
outside the
0 8 . 1 Complete the truth tables for the OR and NAND gates. box

[1 mark]

OR Gate NAND Gate

Inputs Output Inputs Output


0 0 0 0
0 1 0 1
1 0 1 0
1 1 1 1

0 8 . 2 Draw a logic circuit for the Boolean expression:

Q = �������������
A. B + C. B �
[4 marks]

Question 8 continues on the next page

Turn over ►

*13*
IB/M/Jun19/7517/2
14
Do not write
outside the
0 8 . 3 Identities are often applied to help simplify Boolean expressions. One such identity is: box

�=0
A .A

Without using a truth table, explain why this identity is true.


[2 marks]

0 8 . 4 Using the rules of Boolean algebra, simplify the following Boolean expression.

���������
������
� .A.B � + A.B
B

You must show your working.


[4 marks]

Answer 11

*14*
IB/M/Jun19/7517/2
15
Do not write
outside the
0 9 A data communication system uses asynchronous serial communication. box

0 9 . 1 Explain the difference between asynchronous and synchronous communication.


[1 mark]

0 9 . 2 The ASCII code for the digit '0' is 48 in decimal. In ASCII, other digits follow on from
this value in sequence.

The digit '4' is to be transmitted in ASCII using asynchronous serial transmission


and even parity, with the parity bit stored in the most significant bit of the byte of data
containing the ASCII code.

Complete Figure 6 below to show a valid bit pattern for transmitting the digit '4'
[3 marks]

Figure 6
Stop Parity Start
Bit Bit Bit

Question 9 continues on the next page

Turn over ►

*15*
IB/M/Jun19/7517/2
16
Do not write
outside the
0 9 . 3 It is proposed that the communication system is modified so that: box

• a majority voting system is used instead of the parity bit


• Unicode is used to encode the characters to be transmitted instead of ASCII.

Discuss the improvements that will occur in the communication system as a result of
these changes and any disadvantages that will result from them.
[4 marks]

*16*
IB/M/Jun19/7517/2
17
Do not write
outside the
1 0 The greatest common divisor of two positive integers A and B is the largest positive box

integer that divides both of the numbers without leaving a remainder.

For example, if A = 4 and B = 6 then:

• 4 has the divisors 1, 2 and 4


• 6 has the divisors 1, 2, 3 and 6

Therefore, the greatest common divisor of 4 and 6 is 2, since this is the biggest
number which appears in the list of divisors of both 4 and 6.

The method shown in Figure 7 is a famous method for determining the greatest
common divisor of two positive integers, A and B:

Figure 7

WHILE A ≠ B
IF A > B THEN
A = A – B
ELSE
B = B – A
ENDIF
ENDWHILE

When the procedure described in the algorithm terminates, the value in A (and also B)
is the greatest common divisor of A and B.

Question 10 continues on the next page

Turn over ►

*17*
IB/M/Jun19/7517/2
18
Do not write
outside the
box
Table 1 – standard AQA assembly language instruction set

LDR Rd, <memory ref> Load the value stored in the memory location specified by
<memory ref> into register d.
STR Rd, <memory ref> Store the value that is in register d into the memory location
specified by <memory ref>.
ADD Rd, Rn, <operand2> Add the value specified in <operand2> to the value in
register n and store the result in register d.
SUB Rd, Rn, <operand2> Subtract the value specified by <operand2> from the value
in register n and store the result in register d.
MOV Rd, <operand2> Copy the value specified by <operand2> into register d.
CMP Rn, <operand2> Compare the value stored in register n with the value
specified by <operand2>.
B <label> Always branch to the instruction at position <label> in the
program.
B<condition> <label> Branch to the instruction at position <label> if the last
comparison met the criterion specified by <condition>.
Possible values for <condition> and their meanings are:
EQ: equal to NE: not equal to
GT: greater than LT: less than
AND Rd, Rn, <operand2> Perform a bitwise logical AND operation between the value
in register n and the value specified by <operand2> and
store the result in register d.
ORR Rd, Rn, <operand2> Perform a bitwise logical OR operation between the value in
register n and the value specified by <operand2> and
store the result in register d.
EOR Rd, Rn, <operand2> Perform a bitwise logical XOR (exclusive or) operation
between the value in register n and the value specified by
<operand2> and store the result in register d.
MVN Rd, <operand2> Perform a bitwise logical NOT operation on the value
specified by <operand2> and store the result in register d.
LSL Rd, Rn, <operand2> Logically shift left the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
LSR Rd, Rn, <operand2> Logically shift right the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
HALT Stops the execution of the program.
Labels: A label is placed in the code by writing an identifier followed by a colon (:). To refer to a
label, the identifier of the label is placed after the branch instruction.

Interpretation of <operand2>
<operand2> can be interpreted in two different ways, depending on whether the first character
is a # or an R:
• # – use the decimal value specified after the #, eg #25 means use the decimal value 25.
• Rm – use the value stored in register m, eg R6 means use the value stored in register 6.

The available general purpose registers that the programmer can use are numbered 0 to 12.

*18*
IB/M/Jun19/7517/2
19
Do not write
outside the
1 0 . 1 Write a program using the AQA assembly language instruction set, shown on box

page 18 in Table 1, that uses the method described in Figure 7 to calculate the
greatest common divisor of two positive integers.

• At the start, the positive integer A will be stored in memory location 102 and the
positive integer B in memory location 103. Your program should use these values to
find their greatest common divisor.
• When your program terminates it should store the greatest common divisor of these
two numbers in memory location 104.
[8 marks]

Turn over ►

*19*
IB/M/Jun19/7517/2
20
Do not write
outside the
1 1 Questions 11.1, 11.2, 11.3 and 11.4 use a normalised floating point representation box
with an 8-bit mantissa and a 4-bit exponent, both stored using two’s complement.

1 1 . 1 Write the smallest positive number that can be represented by the floating point
system in the boxes below.
[2 marks]

Mantissa Exponent

1 1 . 2 The following is a floating point representation of a number:

1 0 1 1 0 0 1 0 0 0 1 0
Mantissa Exponent

Calculate the decimal equivalent of the number.

You must show your working.


[2 marks]

Answer

1 1 . 3 Write the normalised floating point representation of the decimal value 0.15625
(5/32 as a fraction) in the boxes below.

You must show your working.


[3 marks]

Answer

Mantissa Exponent

*20*
IB/M/Jun19/7517/2
21
Do not write
outside the
1 1 . 4 The two floating point numbers below are multiplied together. box

0 1 0 1 0 0 0 0 0 1 1 1
Mantissa Exponent

0 1 1 0 0 1 0 0 0 0 1 1
Mantissa Exponent

A problem occurs as a result of the multiplication operation.

Explain what problem has occurred and how the floating point representation could be
redesigned to avoid it.
[3 marks]

10

1 2 A particular computer system uses a 32-bit address bus and a 32-bit data bus. Each
addressed memory location can store one byte of data.

1 2 . 1 What is the maximum amount of memory, in bytes, that could be accessed?


[1 mark]

Question 12 continues on the next page

Turn over ►

*21*
IB/M/Jun19/7517/2
22
Do not write
outside the
1 2 . 2 A different computer system has a wider data bus; this will speed up the execution of box
programs.

Explain how the wider data bus has resulted in this effect.
[1 mark]

1 3 Discuss the advantages and disadvantages of representing an image as a vector


graphic instead of as a bitmap.

In your answer, include an example for which it would be most appropriate to use a
vector graphic and an example for which it would be most appropriate to
use a bitmap.
[6 marks]

*22*
IB/M/Jun19/7517/2
23
Do not write
outside the
1 4 . 1 The ciphertext message "BVP" has been received. The message was encrypted using box

the Vernam cipher and the key "TIN".

Conversion between letters and their equivalent binary patterns was carried out using
a special code called the Baudot-Murray code. A version of the Baudot-Murray codes
for each letter is shown in Figure 8.

Figure 8

Letter Encoding Letter Encoding


A 11000 N 00110
B 10011 O 00011
C 01110 P 01101
D 10010 Q 11101
E 10000 R 01010
F 10110 S 10100
G 01011 T 00001
H 00101 U 11100
I 01100 V 01111
J 11010 W 11001
K 11110 X 10111
L 01001 Y 10101
M 00111 Z 10001

Decrypt the ciphertext to work out what the original plaintext message was.

Express the plaintext as letters.

You must show your working.


[3 marks]

Plaintext

Turn over ►

*23*
IB/M/Jun19/7517/2
24

Do not write
outside the
The Vernam cipher can offer perfect security. Most encrypted transmissions that are box
made by computers use ciphers that are computationally secure but not perfectly
secure.

1 4 . 2 Explain what it means for a cipher to be described as being computationally secure.


[1 mark]

Many computerised cipher systems use asymmetric encryption methods to resolve


the key exchange problem that is associated with symmetric ciphers, such as the
Vernam and Caesar ciphers.

1 4 . 3 Explain what the key exchange problem is, in relation to a symmetric cipher.
[2 marks]

*24*
IB/M/Jun19/7517/2
25
Do not write
outside the
1 4 . 4 A message is to be transmitted from computer A to computer B. The message will be box

encrypted using asymmetric encryption. To enable computer B to authenticate that


the message was sent by computer A, a digital signature will also be sent with the
message.

Explain how computer B will decrypt the message and verify that it was sent by
computer A.

In your response you should refer to the specific keys that will be used in this process.

You do not need to explain how computer A will encrypt the message or create the
digital signature.
[4 marks]

10

END OF QUESTIONS

*25*
IB/M/Jun19/7517/2
A-level
COMPUTER SCIENCE
Paper 1

Monday 1 June 2020 Morning Time allowed: 2 hours 30 minutes


Materials
For this paper you must have:
• a computer
• a printer
• appropriate software
• the Electronic Answer Document
• an electronic version and a hard copy of the Skeleton Program
• an electronic version and a hard copy of the Preliminary Material.
You must not use a calculator.

Instructions
• Type the information required on the front of your Electronic Answer Document.
• Before the start of the examination make sure your Centre Number, Candidate Name and
Candidate Number are shown clearly in the footer of every page (also at the top of the front
cover) of your Electronic Answer Document.
• Enter your answers into the Electronic Answer Document.
• Answer all questions.
• Save your work at regular intervals.

Information
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100.
• No extra time is allowed for printing and collating.
• The question paper is divided into four sections.

Advice
You are advised to allocate time to each section as follows:
Section A – 45 minutes; Section B – 20 minutes; Section C – 15 minutes; Section D – 70 minutes.

At the end of the examination


Tie together all your printed Electronic Answer Document pages and hand them to the Invigilator.

Warning
It may not be possible to issue a result for this paper if your details are not on every page of your
Electronic Answer Document.

IB/G/Jun20/E15 7517/1
2

Section A

You are advised to spend no longer than 45 minutes on this section.

Type your answers to Section A in your Electronic Answer Document.

You must save this document at regular intervals.

0 1 Figure 1 shows two vectors a and b and the angle between them, .

Figure 1

a = [4, 3]
b = [4, 0]

The magnitude of a vector, represented as an arrow, is the length of the arrow. The
magnitude of vector a is 5 because �42 +32 = 5

0 1 . 1 What is the magnitude of vector b?


[1 mark]

0 1 . 2 Calculate the dot product of vectors a and b. You should show your working.
[2 marks]

IB/G/Jun20/7517/1
3

The angle between two vectors cannot be larger than 180o. If the angle is measured
as being greater than 180o then this angle is subtracted from 360o to find the actual
angle between the two vectors.

Example: if an angle between two vectors represented as arrows is measured as


being 240o then the angle between the two vectors is 360o – 240o = 120o

0 1 . 3 Describe what will happen to the angle and the magnitude of vector a when vector
a is multiplied by the scalar 2
[2 marks]

0 1 . 4 Describe what will happen to the angle and the magnitude of vector a when vector
a is multiplied by the scalar -1
[2 marks]

Turn over for the next question

Turn over ►
IB/G/Jun20/7517/1
4

0 2 A regular language is a language that can be defined by a regular expression.

0 2 . 1 Complete the unshaded cells of Table 1 to show which of the statements about
regular languages are true and which are false.

Table 1

Statement True or False?

All regular languages can be represented using a finite state


machine without outputs.
The set of strings defined by a regular language is always finite in
size.
There are some languages which can be represented in Backus-
Naur Form (BNF) that are not regular languages.

Copy the contents of the unshaded cells in Table 1 into the table in your Electronic
Answer Document.
[2 marks]

Figure 2 shows a set of Backus-Naur Form (BNF) rules that are used to define a
language.

Figure 2

<sentence> ::= <np><v>


<sentence> ::= <v><np>
<np> ::= <d><n>
<n> ::= human | dog | cat | baby
<d> ::= a | the
<v> ::= ate | slept | drank | cuddle
<c> ::= and | but | or

0 2 . 2 There are two rules in Figure 2 with <sentence> on the left-hand side that are
used to define what a valid sentence is in the language.

Write a single rule that could replace these two rules. Your new rule must not change
what a valid sentence is.
[1 mark]

IB/G/Jun20/7517/1
5

0 2 . 3 Complete the unshaded cells of Table 2 to show which of the strings are valid
sentences for the language defined by the BNF rules in Figure 2

Table 2

String Valid sentence (Y/N)?

cuddle the cat

drank a human

the cat slept

cat or dog

Copy the contents of the unshaded cells in Table 2 into the table in your Electronic
Answer Document.
[1 mark]

0 2 . 4 The sentence dog slept is not currently valid in the language defined in Figure 2

Change the language defined in Figure 2 by either adding or modifying exactly one
rule so that dog slept is a valid sentence.

You must not use the terminals dog or slept directly in the rule you write/change.
[1 mark]

The sentence the cat slept but the dog drank is not currently valid in
the language defined in Figure 2.

To allow this to be a valid sentence either one of the following two additional BNF
rules could be used.

<sentence> ::= <np><v><c><np><v>


<sentence> ::= <sentence><c><sentence>

0 2 . 5 State the number of different sentences defined by the rule:

<sentence> ::= <np><v><c><np><v>

You should only use the rules in Figure 2 when working out your answer to this
question. Do not include any additional sentences that your answer to question 02.4
would make valid.

You can get full marks for this question for stating either the number of valid
sentences or the full calculation needed to work out the number of valid sentences.

You should show your working.


[2 marks]

Turn over ►
IB/G/Jun20/7517/1
6

0 2 . 6 State how many more sentences are defined by the rule:

<sentence> ::= <sentence><c><sentence>

than by the rule:

<sentence> ::= <np><v><c><np><v>


[1 mark]

0 3 . 1 There are four athletes taking part in a race. Each athlete is allocated a lane that they
run in. There can only be one athlete in each lane and there are four lanes available.

How many different permutations are there for allocating athletes to lanes?
[1 mark]

0 3 . 2 If there are n athletes taking part in a race and n lanes available, with each athlete
being allocated to one lane and each lane only used by one athlete, how many
different permutations are there for allocating athletes to lanes?
[1 mark]

0 3 . 3 An anagram of a string is another string that contains exactly the same number of
each character as in the original string but the characters may not all be in the same
positions as in the original string. The original string is also an anagram of itself.

If there are n characters in a string, why will the number of anagrams of the string not
always be the same as your answer to question 03.2?
[1 mark]

0 3 . 4 The travelling salesperson problem (TSP) is when a salesperson has to visit every city
in a set of cities and needs to find the shortest route that does this without visiting any
city more than once before finally returning to the city that they started from.

The TSP is an example of an intractable problem.

Explain what is meant by an intractable problem.


[2 marks]

IB/G/Jun20/7517/1
7

Figure 3 lists some time complexities, where n is the size of the problem input and k
denotes a constant.

Figure 3

O(1)
O(nk)
O(kn)
O(n)
O(log n)
O(n log n)

0 3 . 5 Assuming that the time complexities in Figure 3 are for the most time efficient
algorithm that solves a problem, how many of the time complexities in Figure 3 are for
intractable problems?
[1 mark]

0 3 . 6 State which of the time complexities shown in Figure 3 is the time complexity of the
linear search algorithm and explain why it has that time complexity.
[2 marks]

0 3 . 7 State which of the time complexities shown in Figure 3 is the time complexity of the
binary search algorithm and explain why it has that time complexity.
[2 marks]

0 4 Priority queues and linear queues are examples of data structures.

0 4 . 1 A data structure can be implemented as a dynamic data structure or as a static data


structure.

Discuss the advantages and disadvantages of dynamic data structures compared to


static data structures.
[4 marks]

0 4 . 2 Describe the steps involved in adding an item to a linear queue that has been
implemented as a static data structure using an array. Your answer should include a
description of how any pointers are used and changed.
[3 marks]

0 4 . 3 For a priority queue, the process to determine where a new item should be added is
more complex than it is with a linear queue.

Describe the steps involved when adding an item to a priority queue, implemented as
a static data structure using an array, that were not required when adding an item to a
linear queue.
[3 marks]

Turn over for Section B

Turn over ►
IB/G/Jun20/7517/1
8

Section B

You are advised to spend no more than 20 minutes on this section.

Enter your answers to Section B in your Electronic Answer Document.

You must save this document at regular intervals.

The question in this section asks you to write program code


starting from a new program/project/file.

You are advised to save your program at regular intervals.

0 5 Write a program that asks the user how many numeric digits they would like to enter
and then gets the user to enter that number of numeric digits.

The program should calculate and display the number of times the most frequently
entered numeric digit was input.

Example

If the user says they are going to enter four digits and then enters the
digits 3, 4, 5 and 3, the program should display the value 2 as the most
frequently entered digit was 3 and that digit was entered twice.

If more than one numeric digit had the same frequency and was the most frequently
entered then instead of displaying the frequency, a message saying "Data was
multimodal" should be displayed.

A numeric digit is 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9

You may assume that the number that the user enters to state how many numeric
digits there will be and the numeric digits entered by the user are all valid.

Evidence that you need to provide


Include the following evidence in your Electronic Answer Document.

0 5 . 1 Your PROGRAM SOURCE CODE.


[12 marks]

0 5 . 2 SCREEN CAPTURE(S) showing the result of testing the program by entering:

• the number 6 then the numeric digits 0, 1, 2, 1, 2 and 1


• the number 5 then the numeric digits 0, 1, 2, 2 and 1
[1 mark]

IB/G/Jun20/7517/1
Please write clearly in block capitals.

Centre number Candidate number

Surname

Forename(s)

Candidate signature
I declare this is my own work.

A-level
COMPUTER SCIENCE
Paper 2

Tuesday 9 June 2020 Morning Time allowed: 2 hours 30 minutes


Materials
For this paper you must have:
• a calculator. For Examiner’s Use

Instructions Question Mark


• Use black ink or black ball-point pen. 1
• Fill in the boxes at the top of this page. 2
• Answer all questions.
3
• You must answer the questions in the spaces provided. Do not write outside
the box around each page or on blank pages. 4
• If you need extra space for your answer(s), use the lined pages at the end of 5
this book. Write the question number against your answer(s).
6
• Do all rough work in this book. Cross through any work you do not want to
be marked. 7
8
Information
9
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100. 10
11
Advice
• In some questions you are required to indicate your answer by completely TOTAL
shading a lozenge alongside the appropriate answer as shown.
• If you want to change your answer you must cross out your original answer as
shown.
• If you wish to return to an answer previously crossed out, ring the answer
you now wish to select as shown.

*Jun207517201*
IB/G/Jun20/E16 7517/2
2
Do not write
outside the
Answer all questions. box

0 1 . 1 A sound has been sampled and recorded. The sound was sampled for 1 minute and
40 seconds at a sample rate of 8000 Hz with a 16-bit sample resolution.

A sample rate of 1 Hz means that one sample has been taken every second.

Calculate the minimum amount of storage space, in bytes, needed to store the
sampled sound.

You should show your working.


[2 marks]

Answer

0 1 . 2 An analogue to digital converter (ADC) was used during the sampling process.

Explain the principles of operation of an ADC.


[2 marks]

*02*
IB/G/Jun20/7517/2
3
Do not write
outside the
0 2 Questions 02.2, 02.3, 02.4 and 02.5 use a normalised floating point representation box

with a 7-bit mantissa and a 5-bit exponent, both stored using two’s complement.

0 2 . 1 Non-integer values such as -1.65 and 23/1068 can be represented by a computer


using a fixed point or a floating point system.

State one advantage of using a floating point system over a fixed point system and
one advantage of using a fixed point system over a floating point system.

You should assume that the two systems use the same number of bits to store a
value.
[2 marks]

Advantage of floating point

Advantage of fixed point

0 2 . 2 The following is a floating point representation of a number:

Calculate the decimal equivalent of the number.

Express your answer to at least four decimal places or as a fraction. You should
show your working.
[2 marks]

Answer

Turn over ►

*03*
IB/G/Jun20/7517/2
4
Do not write
outside the
Questions 02.2, 02.3, 02.4 and 02.5 use a normalised floating point representation box

with a 7-bit mantissa and a 5-bit exponent, both stored using two’s complement.

0 2 . 3 Write the normalised floating point representation of the decimal value 1632 in the
boxes below.

You should show your working.


[3 marks]

Answer

*04*
IB/G/Jun20/7517/2
5
Do not write
outside the
Questions 02.2, 02.3, 02.4 and 02.5 use a normalised floating point representation box

with a 7-bit mantissa and a 5-bit exponent, both stored using two’s complement.

0 2 . 4 State, in decimal, the highest (most positive) and lowest (most negative) values that
could be represented by this floating point system.

You should show your working.


[3 marks]

Highest value Lowest value

0 2 . 5 When the decimal value 28.25 is converted into binary using this floating point
system, a rounding error occurs.

Explain:

• why a rounding error has occurred, and


• what the system might do when the value 28.25 is converted into binary.
[2 marks]

12

Turn over ►

*05*
IB/G/Jun20/7517/2
6
Do not write
outside the
0 3 . 1 Figure 1 shows how some of the components inside a computer are connected box

together. The computer uses the von Neumann architecture. Some of the names of
components have been omitted from Figure 1 and replaced with the numbers  to

Figure 1

Complete Table 1 by writing in the Component Number column the numbers from
Figure 1 that correspond to the Component Names.
[2 marks]

Table 1

Component Name Component Number (1–5)

Address Bus

Data Bus

Main Memory

Processor

USB I/O Controller

*06*
IB/G/Jun20/7517/2
7
Do not write
outside the
0 3 . 2 The computer has 4 gibibytes of memory installed. How many kibibytes is this box

equivalent to?
[1 mark]

Answer

0 3 . 3 A tablet computer uses the Harvard architecture. Describe two advantages of using
the Harvard architecture compared to the von Neumann architecture.
[2 marks]

Advantage 1

Advantage 2

Question 3 continues on the next page

Turn over ►

*07*
IB/G/Jun20/7517/2
8
Do not write
outside the
0 3 . 4 The diagram in Figure 2 describes the fetch part of the Fetch-Execute cycle. Some of box

the names of registers have been omitted from the figure and replaced with the
numbers  to 

Figure 2

State the full names of the registers that should appear in the diagram where the
numbers are.
[2 marks]

Number Full Name of Register

0 3 . 5 Interrupts can be generated by devices connected to the processor during the


Fetch-Execute cycle.

Describe the role of interrupts.


[2 marks]

*08*
IB/G/Jun20/7517/2
9
Do not write
outside the
0 3 . 6 Explain why the volatile environment (the contents of registers) must be saved before box

an interrupt is serviced.
[2 marks]

0 3 . 7 Explain the relationship between hardware and software.


[1 mark]

12

Turn over for the next question

Turn over ►

*09*
IB/G/Jun20/7517/2
10
Do not write
outside the
0 4 An estate agency makes details of the properties that it has for sale available to box

potential customers through a website. The details of the properties and other data
that are useful to the agency are stored in a relational database.

The individual web pages about specific properties that a customer can view are
generated dynamically by a program from the data in the database.

A client-server system, which uses CRUD and REST, is used to provide details of
properties in a web page that is being viewed in a web browser on a client computer.

Figure 3 shows the structure of the relations in the database.

Figure 3

Property(PropertyID, HouseNum, Street, Area, Postcode, Bedrooms,


Bathrooms, AskingPrice, SellerID)
Seller(SellerID, Title, Forename, Surname, Telephone)
Buyer(BuyerID, Title, Forename, Surname, Telephone, DesiredArea,
MinBedrooms, MaxPrice)
Viewing(BuyerID, PropertyID, ViewingDate, ViewingTime)
Sale(SaleID, PropertyID, BuyerID, SalePrice)

• The Property relation stores details of the properties that are for sale. This includes
the number of bedrooms and the number of bathrooms that a property has.
• The Seller relation stores details of people who are selling the properties.
• The Buyer relation stores details of the people who are looking to buy a property
and information about the type of property they want, including the area that they
want to live in, the minimum number of bedrooms that they need in a property and
the maximum price that they are prepared to pay.
• An entry is made in the Viewing relation whenever a buyer arranges to look at a
property.
• An entry is made in the Sale relation whenever a property is sold to a buyer. The
SalePrice may be different to the AskingPrice for the property.

0 4 . 1 The list below contains four statements about the principles of CRUD and REST.
One of these statements is false.

Shade one lozenge to indicate which statement is false.


[1 mark]

A CRUD is an acronym for Create, Retrieve, Update, Delete.

REST allows JavaScript to communicate with the server using the HTTP
B
protocol.

C The database is connected to the web browser using REST.

D The REST API will be created and run on the client computer.

*10*
IB/G/Jun20/7517/2
11
Do not write
outside the
An SQL query is executed to retrieve some details about properties with at least four box

bedrooms in a particular area. The following two records are found:

PropertyID HouseNum Street Bedrooms


8026 12 Chester Drive 4
9034 23a Castle Street 5

These records could be sent from the server to the client using XML or JSON.

Figure 4 shows the query results encoded using each of these methods.

Figure 4

Representation 1 Representation 2
{"Properties":[ <Properties>
{ "PropertyID": 8026, <Property>
"HouseNum": "12", <PropertyID>8026</PropertyID>
"Street": "Chester Drive", <HouseNum>12</HouseNum>
"Bedrooms": 4 }, <Street>Chester Drive</Street>
{ "PropertyID": 9034, <Bedrooms>4</Bedrooms>
"HouseNum": "23a", </Property>
"Street": "Castle Street", <Property>
"Bedrooms": 5 } <PropertyID>9034</PropertyID>
]} <HouseNum>23a</HouseNum>
<Street>Castle Street</Street>
<Bedrooms>5</Bedrooms>
</Property>
</Properties>

0 4 . 2 Shade one lozenge to identify the method of encoding used by Representation 2.


[1 mark]
A JSON

B XML

0 4 . 3 State two reasons why it could be argued that JSON is better than XML.
[2 marks]

Reason 1

Reason 2

Turn over ►

*11*
IB/G/Jun20/7517/2
12
Do not write
outside the
0 4 . 4 A composite primary key has been selected for the Viewing relation. This consists of box

the attributes BuyerID, PropertyID and ViewingDate.

In selecting these attributes to form the primary key, what assumption has the
database designer made about the behaviour of the buyers?
[1 mark]

Figure 3 is repeated below so that you can answer Question 04.5 without having to
turn back in the question paper.

Figure 3

Property(PropertyID, HouseNum, Street, Area, Postcode, Bedrooms,


Bathrooms, AskingPrice, SellerID)
Seller(SellerID, Title, Forename, Surname, Telephone)
Buyer(BuyerID, Title, Forename, Surname, Telephone, DesiredArea,
MinBedrooms, MaxPrice)
Viewing(BuyerID, PropertyID, ViewingDate, ViewingTime)
Sale(SaleID, PropertyID, BuyerID, SalePrice)

0 4 . 5 Write an SQL query that will retrieve from the database the list of all properties that
the buyer with BuyerID 23 might be interested in buying. The properties should:

• be in the buyer’s desired area


• have at least the minimum number of bedrooms the buyer requires
• cost no more than the maximum price that the buyer is prepared to pay.

The list of properties returned should only include, for each property, the following
details:

• the PropertyID
• the street that the property is on
• the number of bedrooms that the property has
• the asking price for the property.

The list should be ordered with the most expensive property at the top of the list and
the least expensive at the bottom of the list.
[5 marks]

*12*
IB/G/Jun20/7517/2
13
Do not write
outside the
box

10

Turn over ►

*13*
IB/G/Jun20/7517/2
14
Do not write
outside the
0 5 Figure 5 shows a computer (Computer A) which is located on a LAN in the UK. It is box

connected, via the Internet, to an email server (Computer B) which is located on a


LAN in Belgium.

Computer A has IP address 192.168.2.3 and Computer B has the public IP address
141.134.27.8

Figure 5

0 5 . 1 The computers on subnet 192.168.2.0 have been configured using the DHCP system.

State one advantage of using the DHCP system.


[1 mark]

*14*
IB/G/Jun20/7517/2
15
Do not write
outside the
0 5 . 2 Computer A has the IP address 192.168.2.3 box

Many other computers connected to the Internet have the same IP address.

Explain how two or more computers connected to the Internet can have the same IP
address and still communicate with each other.
[2 marks]

0 5 . 3 In addition to routing, Router A3 also acts as a firewall to protect the computers on


the LAN in the UK.

Explain four different ways that a firewall can protect computers on a LAN.
[4 marks]

Turn over ►

*15*
IB/G/Jun20/7517/2
16
Do not write
outside the
0 5 . 4 A packet of data is to be transmitted across the Internet from Computer A in the UK box

to Computer B in Belgium. A checksum will be used to attempt to detect if any errors


have occurred during the transmission.

Explain how:

• Computer A will use a subnet mask to determine whether or not it can send the
packet directly to Computer B across the LAN or if the packet must be sent via the
Internet
• the packet will be routed across the Internet
• the checksum can be used to determine if the received packet has been changed
during the transmission.

In your answer you will be assessed on your ability to follow a line of reasoning to
produce a coherent, relevant and structured response.
[12 marks]

*16*
IB/G/Jun20/7517/2
17
Do not write
outside the
box

19

Turn over ►

*17*
IB/G/Jun20/7517/2
18
Do not write
outside the
0 6 . 1 Figure 6 shows truth tables for four logic gates. The truth tables are labelled Table A, box

Table B, Table C and Table D.

Figure 6

Table A Table B Table C Table D


Inputs Output Inputs Output Inputs Output Inputs Output
0 0 1 0 0 0 0 0 1 0 0 0
0 1 0 0 1 1 0 1 0 0 1 1
1 0 0 1 0 1 1 0 0 1 0 1
1 1 0 1 1 0 1 1 1 1 1 1

Shade in one lozenge to indicate which truth table does not represent one of the
logic gates: OR, XOR, NOR.
[1 mark]
Table A

Table B

Table C

Table D

*18*
IB/G/Jun20/7517/2
20
Do not write
outside the
A 7-segment display is a component used to display a digit on devices such as box

calculators. A 7-segment display consists of seven lights (called segments) which can
be illuminated individually to make the shapes of digits. For example, the digit 3 could
be displayed by illuminating five of the seven segments like this (black shading
indicates an illuminated segment):

Figure 7 shows part of a logic circuit which is designed to take a binary representation
of a single decimal digit as its input and light up the segments to display the decimal
digit. The part of the circuit shown controls the lighting of just one segment of the
display.

Figure 7

The inputs to the circuit are X3, X2, X1 and X0. Together these form the binary
representation of the decimal digit to display. For example, if the inputs to the circuit
were:

X3 X2 X1 X0
0 1 0 1

then the display would need to show this pattern:

as 0101 is the binary representation of the decimal digit 5

The output Q is connected to one segment of the display. When Q is 1 this segment
lights up, when it is 0 the segment does not light up.

*20*
IB/G/Jun20/7517/2
21
Do not write
outside the
0 6 . 2 Complete every empty cell in the truth table below for the circuit in Figure 7 box

• The listed inputs to the table (X3, X2, X1, X0) represent the decimal digits 0–9 in
binary, which are the only allowed inputs.
• The letters A–E have been used to label intermediate points on the circuit in
Figure 7 to help you to work out the final output Q
• Some of the cells have been completed for you.
[4 marks]
INPUTS INTERMEDIATE POINTS OUTPUT
X3 X2 X1 X0 A B C D E Q
0 0 0 0

0 0 0 1 1 0 1 0 0 0

0 0 1 0

0 0 1 1 1 1 0 0 1 1

0 1 0 0

0 1 0 1 0 0 1 1 1 1

0 1 1 0 0 0 1 1 1 1

0 1 1 1

1 0 0 0 1 0 1 0 0 1

1 0 0 1

Figure 8 shows the patterns of segments that are illuminated for each of the decimal
digits 0–9.
Figure 8

0 6 . 3 By considering the inputs and outputs of the circuit in Figure 7 and consulting your
trace table, state which of the segments in the display (labelled a to g below) the
output Q from the circuit is controlling.
[1 mark]

Output Q is controlling segment

Turn over ►

*21*
IB/G/Jun20/7517/2
22
Do not write
outside the
0 6 . 4 Using the rules of Boolean algebra, simplify the following Boolean expression. box

������������������
��������������
A ∙ (A + 1) ∙ B � ∙ �������������
� + �������
A B+0
You must show your working.
[4 marks]

Answer 10

*22*
IB/G/Jun20/7517/2
23
Do not write
outside the
0 7 . 1 One of the numbers listed below is a member of the set of integers, the set of rational box

numbers and the set of real numbers, but is not a member of either the set of
irrational numbers or the set of natural numbers.

Shade one lozenge to indicate which number this is.


[1 mark]
A –43
12
B
35
C 87

D 107.834

0 7 . 2 Shade one lozenge to indicate which type of number would be most appropriate to
use to measure the length of an item, such as a piece of rope.
[1 mark]
A Integer

B Irrational

C Natural

D Rational

E Real 2

Turn over for the next question

Turn over ►

*23*
IB/G/Jun20/7517/2
24
Do not write
outside the
0 8 A warehouse stores products that are waiting to be delivered to supermarkets. The box

products are packed onto pallets. For example, a pallet might hold 120 boxes of
washing powder. All of the products on one pallet are of the same type.

The individual products on the pallets could be identified by labelling them individually
with barcodes or by attaching RFID (radio-frequency identification) tags to them.

Each barcode/RFID tag would store a representation of a ProductID number that


uniquely identifies the type of product (eg 102546 might represent a specific brand
and box size of washing powder) together with an ItemID number that is unique to the
specific item (eg box number 1 of the washing powder, box number 2 of the washing
powder etc).

Figure 9 shows an example of five boxes of washing powder loaded onto a pallet and
their ProductID and ItemID values.

Figure 9

Figure 10 shows an excerpt from the simple database table that stores the details of
the products that the warehouse has in stock.

Figure 10

ProductID Description QuantityInStock


102546 Washing Powder 1kg box 10 000
398352 Baked Beans 455g tin 1450
293820 Large Dishcloths 300

Some pallets delivered to the warehouse will be of products that already exist in the
database table. Other deliveries will be of pallets of items that don’t exist in the table
because the warehouse has not stocked them before.

*24*
IB/G/Jun20/7517/2
25
Do not write
outside the
0 8 . 1 Explain why the warehouse owners might prefer the individual products to be box

identified using RFID tags.


[2 marks]

0 8 . 2 Explain why the product manufacturers or supermarket owners might prefer the
individual products to be identified using barcode labels.
[2 marks]

Question 8 continues on the next page

Turn over ►

*25*
IB/G/Jun20/7517/2
26
Do not write
outside the
0 8 . 3 Describe how an RFID reader would read the ProductID and ItemID values from RFID box

tags as pallets are delivered and explain how this data could be used to update the
database table that stores details of the products that the warehouse has in stock.

You should include in your description references to the type(s) of SQL statements
(eg INSERT, SELECT, UPDATE) that could be used and their purpose, but you do
not need to write any SQL code.
[6 marks]

10

*26*
IB/G/Jun20/7517/2
27
Do not write
outside the
0 9 Figure 11 shows the format of a machine code instruction for a particular processor box

and one instruction in that format.

Figure 11

0 9 . 1 If the operand can be used to refer to any location in the memory, how many memory
locations can the processor address?
[1 mark]

0 9 . 2 One of the two addressing modes that the processor supports is immediate
addressing.

Explain what is meant by immediate addressing.


[1 mark]

Question 9 continues on the next page

Turn over ►

*27*
IB/G/Jun20/7517/2
28
Do not write
outside the
Table 2 – Standard AQA assembly language instruction set box

LDR Rd, <memory ref> Load the value stored in the memory location specified by
<memory ref> into register d.
STR Rd, <memory ref> Store the value that is in register d into the memory location
specified by <memory ref>.
ADD Rd, Rn, <operand2> Add the value specified in <operand2> to the value in
register n and store the result in register d.
SUB Rd, Rn, <operand2> Subtract the value specified by <operand2> from the value
in register n and store the result in register d.
MOV Rd, <operand2> Copy the value specified by <operand2> into register d.
CMP Rn, <operand2> Compare the value stored in register n with the value
specified by <operand2>.
B <label> Always branch to the instruction at position <label> in the
program.
B <condition> <label> Branch to the instruction at position <label> if the last
comparison met the criterion specified by <condition>.
Possible values for <condition> and their meanings are:
EQ: equal to NE: not equal to
GT: greater than LT: less than
AND Rd, Rn, <operand2> Perform a bitwise logical AND operation between the value
in register n and the value specified by <operand2> and
store the result in register d.
ORR Rd, Rn, <operand2> Perform a bitwise logical OR operation between the value in
register n and the value specified by <operand2> and
store the result in register d.
EOR Rd, Rn, <operand2> Perform a bitwise logical XOR (exclusive or) operation
between the value in register n and the value specified by
<operand2> and store the result in register d.
MVN Rd, <operand2> Perform a bitwise logical NOT operation on the value
specified by <operand2> and store the result in register d.
LSL Rd, Rn, <operand2> Logically shift left the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
LSR Rd, Rn, <operand2> Logically shift right the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
HALT Stops the execution of the program.
Labels: A label is placed in the code by writing an identifier followed by a colon (:). To refer to a
label the identifier of the label is placed after the branch instruction.

Interpretation of <operand2>
<operand2> can be interpreted in two different ways, depending on whether the first character
is a # or an R:

• # – use the decimal value specified after the #, eg #25 means use the decimal value 25
• Rm – use the value stored in register m, eg R6 means use the value stored in register 6

The available general-purpose registers that the programmer can use are numbered 0–12

*28*
IB/G/Jun20/7517/2
29
Do not write
outside the
0 9 . 3 The Vernam cipher encrypts a plaintext character by performing a logical operation box

between a character in the plaintext and part of the key.

Write an assembly language program, using the AQA assembly language


instruction set shown on page 28 in Table 2, to encrypt a plaintext character using
this method.

You should assume that:

• the character code of the plaintext character to be encrypted is stored in memory


location 101
• the part of the key to use to encrypt the character is stored in memory location 102

The encrypted ciphertext character should be stored in memory location 103


[3 marks]

Question 9 continues on the next page

Turn over ►

*29*
IB/G/Jun20/7517/2
30
Do not write
outside the
0 9 . 4 A message has been encrypted using the Caesar cipher with a key value of 5 box

Using the Caesar cipher, each capital letter is replaced by another capital letter (as
determined by the key value) whenever it is encrypted or decrypted.
The pseudocode in Figure 12 is supposed to decrypt a single capital letter character
in the message, but it does not work properly.

Figure 12

asciicode  CHAR_TO_INT(ciphertextcharacter)
asciicode  asciicode - 5
plaintextcharacter  INT_TO_CHAR(asciicode)

• CHAR_TO_INT is a function that returns the ASCII code of a character.


• INT_TO_CHAR is a function that returns the character corresponding to an ASCII
code.

The ASCII code for capital letters is shown in Figure 13.

Figure 13

Letter ASCII Letter ASCII


Code Code
A 65 N 78
B 66 O 79
C 67 P 80
D 68 Q 81
E 69 R 82
F 70 S 83
G 71 T 84
H 72 U 85
I 73 V 86
J 74 W 87
K 75 X 88
L 76 Y 89
M 77 Z 90

By analysing the pseudocode in Figure 12, explain what the problem with the
algorithm represented by the pseudocode is and how it could be rectified.
[3 marks]

*30*
IB/G/Jun20/7517/2
32
Do not write
outside the
1 0 A company provides a social media service through which members can share box

information about themselves and view information and news from their friends.

The service also displays current affairs news stories to its members. The service
does not have journalists who write the stories but instead it uses algorithms to select
news stories written by other organisations and individuals and shows these.
Different news stories may be shown to different members.

Discuss:

• how algorithms might determine which current affairs news stories to display to an
individual member
• the moral, ethical and legal considerations that the developers of the system and its
operators should consider in relation to how the algorithms work and which news
stories are displayed.
[6 marks]

*32*
IB/G/Jun20/7517/2
33
Do not write
outside the
box

Turn over for the next question

Turn over ►

*33*
IB/G/Jun20/7517/2
34
Do not write
outside the
1 1 . 1 The list towers is defined as: box

towers = ["Blackpool", "Paris", "New Brighton", "Toronto"]

What are the head and tail of this list?


[1 mark]

Head

Tail

1 1 . 2 Figure 14 shows some code written in a functional programming language.

Figure 14

total [] = 0
total (x:xs) = x + total (xs)

The following notes are provided to help you understand the syntax of the code in
Figure 14:

• [] is the empty list


• (x:xs) as the argument to a function splits a list into two parts, the head x and
tail xs.

Describe how the total function works to add up all of the numbers in a list.
[3 marks]

*34*
IB/G/Jun20/7517/2
35
Do not write
outside the
Functional programming languages support higher-order functions such as map and box

fold.

1 1 . 3 Explain what a higher-order function is.


[2 marks]

1 1 . 4 What is the result of this application of the fold function?

fold (*) 1 [2, 3, 2]


[1 mark]
7
Result

END OF QUESTIONS

*35*
IB/G/Jun20/7517/2
A-level
COMPUTER SCIENCE
Paper 1

Time allowed: 2 hours 30 minutes


Materials
For this paper you must have:
• a computer
• a printer
• appropriate software
• the Electronic Answer Document
• an electronic version and a hard copy of the Skeleton Program
• an electronic version and a hard copy of the Preliminary Material
• an electronic version of the Data File game1.txt.
You must not use a calculator.

Instructions
• Type the information required on the front of your Electronic Answer Document.
• Before the start of the examination make sure your Centre Number, Candidate Name and
Candidate Number are shown clearly in the footer of every page (also at the top of the front
cover) of your Electronic Answer Document.
• Enter your answers into the Electronic Answer Document.
• Answer all questions.
• Save your work at regular intervals.

Information
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100.
• No extra time is allowed for printing and collating.
• The question paper is divided into four sections.

Advice
You are advised to allocate time to each section as follows:
Section A – 45 minutes; Section B – 20 minutes; Section C – 15 minutes; Section D – 70 minutes.

At the end of the examination


Tie together all your printed Electronic Answer Document pages and hand them to the Invigilator.

Warning
It may not be possible to issue a result for this paper if your details are not on every page of your
Electronic Answer Document.

IB/G/Jun21/E13 7517/1
2

There are no questions printed on this page

IB/G/Jun21/7517/1
3

Section A

You are advised to spend no longer than 45 minutes on this section.

Type your answers to Section A in your Electronic Answer Document.

You must save this document at regular intervals.

0 1 The shaded row of Table 1 contains a list of numbers.

A bubble sort algorithm could be used to sort the list of numbers into ascending order.

Complete the unshaded cells of Table 1 to show the results of completing three
passes through the list using a bubble sort algorithm.

You should state the values at the end of each pass.

Table 1

[0] [1] [2] [3] [4] [5]


3 5 8 1 6 4
First pass
Second pass
Third pass

Copy the contents of the unshaded cells in Table 1 into the table in your Electronic
Answer Document.
[3 marks]

Turn over for the next question

Turn over ►
IB/G/Jun21/7517/1
4

0 2 Figure 1 shows a binary tree containing seven nodes. Figure 2 shows how the
binary tree in Figure 1 could be represented using three one-dimensional arrays:
Data, Dir1 and Dir2.

Figure 1

Figure 2

Index Data Dir1 Dir2


[0] C 1 4
[1] I 2 3
[2] E -1 -1
[3] H -1 -1
[4] B 5 6
[5] Y -1 -1
[6] Q -1 -1

0 2 . 1 Define the term binary tree.


[2 marks]

0 2 . 2 The output of a post-order traversal algorithm used to print the data item at each node
in the binary tree shown in Figure 1 would be E, H, I, Y, Q, B, C.

State the output that would be produced by an in-order traversal algorithm.


[2 marks]

IB/G/Jun21/7517/1
5

Figure 3 shows pseudo-code for a subroutine called Traversal that uses the three
arrays from Figure 2.
Figure 3

SUBROUTINE Traversal(StartNode)
Current  StartNode
Pos  0
Stack[Pos]  Current
WHILE Pos ≠ -1
Current  Stack[Pos]
Pos  Pos – 1
OUTPUT Data[Current]
IF Dir2[Current] ≠ -1 THEN
Pos  Pos + 1
Stack[Pos]  Dir2[Current]
ENDIF
IF Dir1[Current] ≠ -1 THEN
Pos  Pos + 1
Stack[Pos]  Dir1[Current]
ENDIF
ENDWHILE
ENDSUBROUTINE

0 2 . 3 Complete the unshaded cells in Table 2 to show the result of the subroutine call
Traversal(0)
Table 2

Stack
Current Pos [0] [1] [2] [3] Output

Copy the contents of the unshaded cells in Table 2 into the table in your Electronic
Answer Document.
[7 marks]

Turn over ►
IB/G/Jun21/7517/1
6

Figure 3 (repeated)

SUBROUTINE Traversal(StartNode)
Current  StartNode
Pos  0
Stack[Pos]  Current
WHILE Pos ≠ -1
Current  Stack[Pos]
Pos  Pos – 1
OUTPUT Data[Current]
IF Dir2[Current] ≠ -1 THEN
Pos  Pos + 1
Stack[Pos]  Dir2[Current]
ENDIF
IF Dir1[Current] ≠ -1 THEN
Pos  Pos + 1
Stack[Pos]  Dir1[Current]
ENDIF
ENDWHILE
ENDSUBROUTINE

0 2 . 4 The subroutine shown in Figure 3 could have been written so that it used recursion
instead of iteration.

Explain what is meant by a recursive subroutine.


[1 mark]

0 2 . 5 Explain what is meant by a base case for a recursive subroutine.


[1 mark]

0 2 . 6 If the subroutine shown in Figure 3 had been written using recursion, a stack frame
would have been stored each time a recursive subroutine call was made.

State two components of a stack frame.


[2 marks]

IB/G/Jun21/7517/1
7

0 3 Explain what is meant by procedural decomposition.


[3 marks]

0 4 Describe the steps involved in adding a record to a hash table.


[5 marks]

0 5 . 1 State two advantages of using Reverse Polish Notation (RPN) instead of infix notation
to represent an expression.
[2 marks]

0 5 . 2 Describe how a single stack could be used to evaluate an RPN expression.


[4 marks]

Turn over for the next question

Turn over ►
IB/G/Jun21/7517/1
8

0 6 The state transition diagram for a finite state machine (FSM) is shown in Figure 4.

Figure 4

0 6 . 1 An FSM can also be represented as a state transition table.

Complete the state transition table, Table 3, so that it represents the parts of the state
transition diagram shown in Figure 4 that involve state S2.

Table 3

Current state Input New state

Copy the contents of the unshaded cells in Table 3 into the table in your Electronic
Answer Document.
[2 marks]

0 6 . 2 Regular expressions can be used to recognise the same strings as FSMs without
output.

Write a regular expression that will recognise the same set of strings that are
accepted by the FSM shown in Figure 4.
[3 marks]

IB/G/Jun21/7517/1
9

Section B

You are advised to spend no more than 20 minutes on this section.

Enter your answers to Section B in your Electronic Answer Document.

You must save this document at regular intervals.

The question in this section asks you to write program code


starting from a new program/project/file.

You are advised to save your program at regular intervals.

0 7 A Harshad number is a positive integer which is exactly divisible by the sum of its
digits. The first twelve Harshad numbers are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12 and 18

• 36 is a Harshad number. The digits of 36 are 3 and 6; the sum of these digits is 9
as 3 + 6 = 9 and 36 is exactly divisible by 9 (36 ÷ 9 = 4)

• 300 is a Harshad number. The digits of 300 are 3, 0 and 0; the sum of these digits
is 3 as 3 + 0 + 0 = 3 and 300 is exactly divisible by 3 (300 ÷ 3 = 100)

• 15 is not a Harshad number. The digits of 15 are 1 and 5; the sum of these digits is
6 as 1 + 5 = 6 and 15 is not exactly divisible by 6

Write a program that asks the user to enter a number, n, and will then calculate and
display the nth Harshad number.

Example

If the user enters the number 12 then the program should calculate and
display the twelfth Harshad number. The twelfth Harshad number is 18

You may assume that the number that the user enters will be a positive integer.

Evidence that you need to provide


Include the following evidence in your Electronic Answer Document.

0 7 . 1 Your PROGRAM SOURCE CODE.


[12 marks]

0 7 . 2 SCREEN CAPTURE(S) showing the result of testing the program by entering the
number 600
[1 mark]

Turn over ►
IB/G/Jun21/7517/1
Please write clearly in block capitals.

Centre number Candidate number

Surname

Forename(s)

Candidate signature
I declare this is my own work.

A-level
COMPUTER SCIENCE
Paper 2
Time allowed: 2 hours 30 minutes
Materials
For this paper you must have:
• a calculator. For Examiner’s Use

Instructions Question Mark


• Use black ink or black ball-point pen. 1
• Fill in the boxes at the top of this page. 2
• Answer all questions.
• You must answer the questions in the spaces provided. Do not write outside 3
the box around each page or on blank pages. 4
• If you need extra space for your answer(s), use the lined pages at the end of 5
this book. Write the question number against your answer(s).
6
• Do all rough work in this book. Cross through any work you do not want to
be marked. 7
8
Information
9
• The marks for questions are shown in brackets.
• The maximum mark for this paper is 100. 10
11
Advice 12
• In some questions you are required to indicate your answer by completely
13
shading a lozenge alongside the appropriate answer as shown.
• If you want to change your answer you must cross out your original answer as 14
shown.
TOTAL
• If you wish to return to an answer previously crossed out, ring the answer
you now wish to select as shown.

*JUN217517201*
IB/G/Jun21/E17 7517/2
2
Do not write
outside the
Answer all questions. box

0 1 . 1 A bitmap image is 1000 pixels wide by 800 pixels high.

The image takes up 400 kB of storage space when represented as a bitmap,


excluding metadata.

Calculate the maximum number of different colours that could appear in the image.

You should show your working.


[3 marks]

Answer

*02*
IB/G/Jun21/7517/2
3
Do not write
outside the
0 1 . 2 The same image can also be represented using vector graphics. box

The vector graphics representation of the image takes up 2 kB of storage space.

Explain why the amount of storage space taken up by the vector graphics
representation of the image is significantly smaller than the space taken up by the
bitmap representation.
[3 marks]

0 1 . 3 One advantage of vector graphics compared to bitmap graphics is that fewer bytes
are used to represent an image.

State two other advantages of vector graphics compared with bitmap graphics.
[2 marks]

Advantage 1

Advantage 2

Turn over for the next question

Turn over ►

*03*
IB/G/Jun21/7517/2
4
Do not write
outside the
0 2 Describe what thin-client computing is and explain two reasons why a thin-client box

system might be chosen in preference to a thick-client system.


[3 marks]

0 3 A data communications system can transmit four different signals. Each different
signal represents two bits of data.

0 3 . 1 Describe the exact relationship between the bit rate and the baud rate for this
system.
[1 mark]

0 3 . 2 Describe the relationship between the bit rate of the system and the bandwidth of the
transmission medium that the data is transmitted through.
[1 mark]

*04*
IB/G/Jun21/7517/2
5
Do not write
outside the
0 3 . 3 The system uses serial transmission. box

Describe the difference between the operation of serial and parallel transmission.
[2 marks]

Turn over for the next question

Turn over ►

*05*
IB/G/Jun21/7517/2
6
Do not write
outside the
0 4 Figure 1 shows a circuit with inputs X0 to X2 and outputs Q0 to Q7 box

Figure 1

0 4 . 1 Write a Boolean expression to represent the output Q1 of the circuit in Figure 1.


[1 mark]

Q1 =

*06*
IB/G/Jun21/7517/2
7
Do not write
outside the
0 4 . 2 Complete the truth table below for the circuit in Figure 1. box

[3 marks]

INPUTS OUTPUTS
X2 X1 X0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

0 4 . 3 Explain the purpose of the circuit in Figure 1.

Considering the inputs and outputs of the circuit and consulting your answers to
Question 04.1 and Question 04.2 may help you to do this.
[2 marks]

Question 4 continues on the next page

Turn over ►

*07*
IB/G/Jun21/7517/2
8
Do not write
outside the
Figure 1 is repeated below to help you answer Question 04.4. box

Figure 1 (repeated)

*08*
IB/G/Jun21/7517/2
9
Do not write
outside the
0 4 . 4 The logic circuit in Figure 2 produces an output S that is equivalent to one of the box

outputs of the logic circuit in Figure 1, for the inputs X0, X1 and X2.

Figure 2

Which output (Q0 to Q7) from Figure 1 is the output S from the circuit in Figure 2
equivalent to?
[1 mark]
7

Turn over for the next question

Turn over ►

*09*
IB/G/Jun21/7517/2
10
Do not write
outside the
0 5 A sports centre uses a relational database to store information about its facilities box

(such as the swimming pool) and the bookings that have been made to use them.

Figure 3 shows the structure of the relations in the database.

Figure 3

Facility(FacilityID, Description, MaxPeople, PricePerHour)


FacilityForSport(Sport, FacilityID)
Booking(FacilityID, BookingDate, StartTime, EndTime, CustomerID)
Customer(CustomerID, Forename, Surname, EmailAddress)

• The Facility relation stores the different facilities available at the sports centre.
Each one is identified by a unique number and has a brief description. For
example, the facility with FacilityID 1 has the description ‘Outdoor Pitch A’.
PricePerHour is the price of hiring a facility for 1 hour. For example, the facility with
FacilityID 1 has a price per hour of £17.50.
• The FacilityForSport relation identifies which facilities are suitable for which sports.
For example, the facility with FacilityID 1 is suitable for football, rugby and hockey
and would therefore require three separate records in this relation.
• The Booking relation stores the bookings that have been made. Bookings must
start and end either on the hour, at quarter past, half past or quarter to the hour.
A customer can make bookings for more than one facility for the same time. For
example, a badminton club secretary might book both of the indoor sports halls for
the same time. However, each facility can only be booked by one customer at any
one time.
• The Customer relation stores the details of customers who have made bookings.

0 5 . 1 The entity identifier (primary key) for the Booking relation is a composite entity
identifier, consisting of these three attributes:

FacilityID, BookingDate, StartTime

An alternative entity identifier could have been chosen, composed of different


attributes.

Shade one lozenge to indicate which of the following groups of attributes would form
a valid alternative entity identifier for the Booking relation.
[1 mark]

A BookingDate, StartTime, EndTime

B FacilityID, BookingDate, EndTime

C FacilityID, StartTime, CustomerID

D FacilityID, BookingDate, EndTime, Sport

*10*
IB/G/Jun21/7517/2
11
Do not write
outside the
0 5 . 2 A different design was originally proposed for the database. This design did not have box

the Customer relation and had the following design for the Booking relation:

Booking(FacilityID, BookingDate, StartTime, EndTime, Forename, Surname,


EmailAddress)

Explain why this alternative design would have been rejected in favour of the design in
Figure 3.
[2 marks]

0 5 . 3 Complete the following SQL statement to create the Facility relation specified in
Figure 3, including the primary key.
[3 marks]

CREATE TABLE Facility (

Question 5 continues on the next page

Turn over ►

*11*
IB/G/Jun21/7517/2
12
Do not write
outside the
Figure 3 is repeated below to help you answer Question 05.4 without having to turn box

back in the question paper.

Figure 3 (repeated)

Facility(FacilityID, Description, MaxPeople, PricePerHour)


FacilityForSport(Sport, FacilityID)
Booking(FacilityID, BookingDate, StartTime, EndTime, CustomerID)
Customer(CustomerID, Forename, Surname, EmailAddress)

0 5 . 4 A customer wants to book a facility that is suitable for playing basketball on the
15/06/2021 between 14:15 and 16:15

As part of the booking process, a query is needed to list all the existing bookings that
would overlap with the new booking.

Write a query that will list all the bookings for facilities that are suitable for playing
basketball and which would overlap with the booking that the customer wants to
make.

For each booking which would overlap with the new booking only the FacilityID,
StartTime and EndTime fields should be listed.
[7 marks]

*12*
IB/G/Jun21/7517/2
13
Do not write
outside the
box

13

Turn over for the next question

Turn over ►

*13*
IB/G/Jun21/7517/2
15
Do not write
outside the
This table is included so that you can answer Question 06.1 on page 17. box

Table 1 – Standard AQA assembly language instruction set

LDR Rd, <memory ref> Load the value stored in the memory location specified by
<memory ref> into register d.
STR Rd, <memory ref> Store the value that is in register d into the memory location
specified by <memory ref>.
ADD Rd, Rn, <operand2> Add the value specified in <operand2> to the value in
register n and store the result in register d.
SUB Rd, Rn, <operand2> Subtract the value specified by <operand2> from the value
in register n and store the result in register d.
MOV Rd, <operand2> Copy the value specified by <operand2> into register d.
CMP Rn, <operand2> Compare the value stored in register n with the value
specified by <operand2>.
B <label> Always branch to the instruction at position <label> in the
program.
B <condition> <label> Branch to the instruction at position <label> if the last
comparison met the criterion specified by <condition>.
Possible values for <condition> and their meanings are:
EQ: equal to NE: not equal to
GT: greater than LT: less than
AND Rd, Rn, <operand2> Perform a bitwise logical AND operation between the value
in register n and the value specified by <operand2> and
store the result in register d.
ORR Rd, Rn, <operand2> Perform a bitwise logical OR operation between the value in
register n and the value specified by <operand2> and
store the result in register d.
EOR Rd, Rn, <operand2> Perform a bitwise logical XOR (exclusive or) operation
between the value in register n and the value specified by
<operand2> and store the result in register d.
MVN Rd, <operand2> Perform a bitwise logical NOT operation on the value
specified by <operand2> and store the result in register d.
LSL Rd, Rn, <operand2> Logically shift left the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
LSR Rd, Rn, <operand2> Logically shift right the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
HALT Stops the execution of the program.
Labels: A label is placed in the code by writing an identifier followed by a colon (:). To refer to a
label, the identifier of the label is placed after the branch instruction.

Interpretation of <operand2>
<operand2> can be interpreted in two different ways, depending on whether the first character
is a # or an R:

• # – use the decimal value specified after the #, eg #25 means use the decimal value 25
• Rm – use the value stored in register m, eg R6 means use the value stored in register 6

The available general-purpose registers that the programmer can use are numbered 0–12
Turn over ►

*15*
IB/G/Jun21/7517/2
16
Do not write
outside the
0 6 Figure 4 shows an assembly language program which has been written using the box

AQA assembly language instruction set. The instruction set is explained in Table 1
on page 15.

Figure 4

CMP R2, #0
BEQ exit
MOV R0, #0
MOV R3, #1
moveleft:
LSL R2, R2, #1
LSL R3, R3, #1
CMP R2, R1
BLT moveleft
BEQ mainloop
LSR R2, R2, #1
LSR R3, R3, #1
mainloop:
CMP R1, R2
BLT skip
ADD R0, R0, R3
SUB R1, R1, R2
skip:
AND R4, R3, #1
CMP R4, #1
BEQ skipshiftR2
LSR R2, R2, #1
skipshiftR2:
LSR R3, R3, #1
CMP R3, #0
BNE mainloop
exit:
HALT

The program takes its input values from registers R1 and R2 and stores its output in
registers R0 and R1

*16*
IB/G/Jun21/7517/2
17
Do not write
outside the
0 6 . 1 Complete the trace table below to show the results of executing the program in box

Figure 4 when the initial values in registers R1 and R2 are 34 and 6

Each register can hold a 16-bit value.

You may find it easier to understand the operation of the program if you write the
contents of the registers out in both binary and decimal.

You may not need to use all the rows in the table.
[6 marks]

R0 R1 R2 R3 R4
100010 (34) 110 (6)

Question 06 continues on the next page

Turn over ►

*17*
IB/G/Jun21/7517/2
18
Do not write
outside the
0 6 . 2 The initial values for the program (its inputs) are stored in R1 and R2 and the final box

values stored in R0 and R1 are its outputs.

By considering the inputs and the outputs in your trace table for Question 06.1,
describe the purpose of the program.
[2 marks]

0 7 . 1 Explain why a laser printer with a built-in wireless network adapter is likely to be a
suitable choice of printer for a small office.
[3 marks]

*18*
IB/G/Jun21/7517/2
19
Do not write
outside the
0 7 . 2 Describe the principles of operation of a laser printer. box

[6 marks]

Turn over for the next question

Turn over ►

*19*
IB/G/Jun21/7517/2
20
Do not write
outside the
0 8 Use binary addition in 8-bit two’s complement to perform the subtraction: box

18 – 72

You must show both your working and your final answer in binary.
[2 marks]

*20*
IB/G/Jun21/7517/2
22
Do not write
outside the
0 9 Big Data is an important application area for modern computer science. box

• Describe what Big Data is, using examples to illustrate your description.

• Explain some of the challenges that Big Data brings with it and the approaches that
can be taken to overcome these, in relation to programming and hardware.

• Consider some of the ethical and legal issues that might arise in applications that
store data, particularly data about people.
[12 marks]

*22*
IB/G/Jun21/7517/2
23
Do not write
outside the
box

12

Turn over ►

*23*
IB/G/Jun21/7517/2
24
Do not write
outside the
1 0 A particular computer uses a normalised floating point representation with an 8-bit box

mantissa and a 4-bit exponent, both stored using two’s complement.

1 0 . 1 Four-bit patterns that are stored in this computer’s memory are listed in Figure 5 and
are labelled with the letters A to D. Three of the bit patterns are valid normalised
floating point numbers and one is not.

Figure 5

Complete Table 2 below. In the Correct letter (A–D) column write the appropriate
letter from A to D to indicate which bit pattern in Figure 5 is an example of the type of
value described in the Value description column.

Do not use the same letter more than once.

Table 2

Value description Correct letter (A–D)

A negative value that is valid in the representation.

The largest positive value that can be represented in


the system.
A value that is not valid in the representation because
it is not normalised.
[3 marks]

*24*
IB/G/Jun21/7517/2
25
Do not write
outside the
1 0 . 2 Figure 6 shows a floating point representation of a number: box

Figure 6

Calculate the decimal equivalent of the number.

You should show your working.


[2 marks]

Answer

In this floating point system, the closest possible representation of the decimal
number 104.7 is shown in Figure 7.

Figure 7

By converting this number back to decimal it can be seen that the actual value stored
is 105

1 0 . 3 Calculate the absolute error that has occurred when representing 104.7 in Figure 7.
[1 mark]

Answer

Question 10 continues on the next page

Turn over ►

*25*
IB/G/Jun21/7517/2
26
Do not write
outside the
1 0 . 4 Calculate the relative error that has occurred when representing 104.7 in Figure 7. box

Express your answer as a percentage to two decimal places.


[1 mark]

Answer

1 0 . 5 Explain why the relative error is usually considered to be a more important measure of
error than the absolute error.
[1 mark]

*26*
IB/G/Jun21/7517/2
27
Do not write
outside the
1 1 Figure 8 shows a computer network. The devices connected to the network are box

identified using IPv4 addresses. When assigning IP addresses, 20 bits have been
allocated to the Network IDs (also known as Subnet IDs or subnet addresses) and
12 bits have been allocated to the Host IDs.

Figure 8

1 1 . 1 State suitable IP addresses for:


[3 marks]

The Router 1 port labelled

The Router 1 port labelled

The computer labelled

Question 11 continues on the next page

Turn over ►

*27*
IB/G/Jun21/7517/2
28
Do not write
outside the
1 1 . 2 Shade one lozenge to indicate which of the following four subnet masks is the one box

that has been assigned to the devices connected to the network in Figure 8.
[1 mark]

A 255.255.0.0

B 255.255.15.0

C 255.255.240.0

D 255.255.255.0

1 1 . 3 The devices on the network in Figure 8 use IPv4.

State one reason why IPv6 has been introduced to replace IPv4.
[1 mark]

1 1 . 4 State the name of the physical topology used in subnet 192.168.64.0 in Figure 8.
[1 mark]

*28*
IB/G/Jun21/7517/2
29
Do not write
outside the
1 1 . 5 Laptop computers and other devices can connect to the network via the wireless box

access point. The wireless connection uses the CSMA/CA protocol with Request to
Send/Clear to Send (RTS/CTS).

A laptop connected to the wireless access point has data to send to another
computer.

Explain how the CSMA/CA protocol with RTS/CTS will be used during this
transmission.
[6 marks]

12

Turn over ►

*29*
IB/G/Jun21/7517/2
30
Do not write
outside the
1 2 Describe how MIDI is used to represent digital music. box

[2 marks]

1 3 . 1 Describe the difference between application software and system software.


[2 marks]

1 3 . 2 Utilities are a type of system software.

Describe what utilities are and include an example of a utility in your answer.
[2 marks]

*30*
IB/G/Jun21/7517/2
31
Do not write
outside the
1 4 . 1 Shade one lozenge to indicate which of these statements about a computer that uses box

the stored program concept is false.


[1 mark]

A Instructions are fetched and executed in sequence.

B The computer can only be used with one program.

C The data is stored in the main memory.

D The program is stored in the main memory.

1 4 . 2 The control unit is an important component of a processor.

Describe the role of the control unit.


[3 marks]

Question 14 continues on the next page

Turn over ►

*31*
IB/G/Jun21/7517/2
32
Do not write
outside the
1 4 . 3 One method that can be used to improve the performance of a processor is to box

increase the amount of cache memory.

Describe:

• what cache memory is


• what cache memory is used for
• how increasing the amount of cache memory can improve the performance of a
processor.
[4 marks]

END OF QUESTIONS

*32*
IB/G/Jun21/7517/2
A-level
COMPUTER SCIENCE
Paper 1

Time allowed: 2 hours 30 minutes


Materials
For this paper you must have:
a computer
a printer
appropriate software
the Electronic Answer Document
an electronic version and a hard copy of the Skeleton Program
an electronic version and a hard copy of the Preliminary Material
an electronic version of the Data Files game1.txt and locks.txt
You must not use a calculator.

Instructions
Type the information required on the front of your Electronic Answer Document.
Before the start of the examination make sure your Centre Number, Candidate Name and
Candidate Number are shown clearly in the footer of every page (also at the top of the front
cover) of your Electronic Answer Document.
Enter your answers into the Electronic Answer Document.
Answer all questions.
Save your work at regular intervals.

Information
The marks for questions are shown in brackets.
The maximum mark for this paper is 100.
No extra time is allowed for printing and collating.
The question paper is divided into four sections.

Advice
You are advised to allocate time to each section as follows:
Section A – 40 minutes; Section B – 20 minutes; Section C – 20 minutes; Section D – 70 minutes.

At the end of the examination


Tie together all your printed Electronic Answer Document pages and hand them to the Invigilator.

Warning
It may not be possible to issue a result for this paper if your details are not on every page of your
Electronic Answer Document.

IB/G/Jun22/E12 7517/1
2

Section A

You are advised to spend no longer than 40 minutes on this section.

Type your answers to Section A in your Electronic Answer Document.

You must save this document at regular intervals.

0 1 Big-O notation is used to express the time complexity of an algorithm. Table 1


contains a list of algorithms.

State the Big-O time complexity of each of these algorithms. The first row has been
completed for you.

Table 1

Algorithm Time complexity

Binary tree search O(log n)

Bubble sort

Linear search

Merge sort

Copy the contents of the unshaded cells in Table 1 into the table in your Electronic
Answer Document.
[3 marks]

IB/G/Jun22/7517/1
3

0 2 A queue data structure can be implemented as a static data structure using an array.

0 2 . 1 Describe the method that would need to be followed to attempt to remove an item
from a circular queue implemented as a static data structure using an array.

Your method should deal appropriately with any issues which could arise.
[4 marks]

0 2 . 2 Describe three differences between dynamic and static data structures.


[3 marks]

Figure 1 shows data that has been stored in a stack implemented using an array S.

Figure 1

[7]

[6]

[5]

[4]

[3]

[2] Jib Top = 2

[1] Skye

[0] Harry

0 2 . 3 What value will be returned by applying the peek operation to S?


[1 mark]

0 2 . 4 What value will be returned by applying the pop operation to S?


[1 mark]

0 2 . 5 Explain how a single stack can be used to reverse the order of the items in a queue.
[2 marks]

Turn over for the next question

IB/G/Jun22/7517/1
4

0 3 Figure 2 shows a logic puzzle.

Figure 2

Which one of these six statements is correct?

Statement 1: All of the statements below are correct.

Statement 2: None of the statements below are correct.

Statement 3: All of the statements above are correct.

Statement 4: Exactly one of the statements above is correct.

Statement 5: None of the statements above are correct.

Statement 6: None of the statements above are correct.

0 3 . 1 Explain why Statement 1 is not correct.


[1 mark]

0 3 . 2 Which one of the six statements in Figure 2 is correct?


[1 mark]

0 3 . 3 For two statements other than Statement 1 and your answer to Question 03.2, explain
why those statements are not correct.
[2 marks]

IB/G/Jun22/7517/1
5

0 4 . 1 For each of the statements in Table 2, complete each row to indicate if the statement
is true or false for Dijkstra’s algorithm.

Table 2

True or
False?
Calculates the shortest path between a node and other
nodes in a graph.
Can be used to prove that the Halting Problem cannot be
solved.

Can be used with both directed and undirected graphs.

Can be used with both weighted and unweighted graphs.

Copy the contents of the unshaded cells in Table 2 into the table in your Electronic
Answer Document.
[2 marks]

Figure 3 shows a subroutine represented using pseudo-code. The subroutine makes


use of an array Visited and an array ConnectedNodes that stores a graph
represented as an adjacency list.

Figure 3

FUNCTION G(V, P)
Visited[V] True
FOR EACH N IN ConnectedNodes[V]
IF Visited[N] = False THEN
IF G(N, V) = True THEN
RETURN True
ENDIF
ELSE IF N P THEN
RETURN True
ENDIF
ENDFOR
RETURN False
ENDFUNCTION

0 4 . 2 The subroutine G uses recursion.

Explain what is meant by a recursive subroutine.


[1 mark]

Question 4 continues on the next page

IB/G/Jun22/7517/1
6

Figure 3 (repeated)

FUNCTION G(V, P)
Visited[V] True
FOR EACH N IN ConnectedNodes[V]
IF Visited[N] = False THEN
IF G(N, V) = True THEN
RETURN True
ENDIF
ELSE IF N P THEN
RETURN True
ENDIF
ENDFOR
RETURN False
ENDFUNCTION

Figure 4 shows a subroutine represented using pseudo-code. The subroutine makes


use of the array Visited.

Figure 4
FUNCTION F()
FOR Count 0 TO LENGTH(Visited) - 1
IF Visited[Count] = False THEN
RETURN False
ENDIF
ENDFOR
RETURN True
ENDFUNCTION

Figure 5 shows a subroutine represented using pseudo-code. The subroutine makes


use of the subroutine G shown in Figure 3, the subroutine F shown in Figure 4 and
the array Visited.

Figure 5

FUNCTION E()
Set all elements of Visited to False
IF G(0, -1) = True THEN
RETURN False
ELSE
RETURN F()
ENDIF
ENDFUNCTION

IB/G/Jun22/7517/1
7

Figure 6 shows a graph consisting of three nodes, the contents of the array
ConnectedNodes when it is used to represent this graph, and the contents of the
array Visited after the subroutine call G(0, -1).

Figure 6

0 4 . 3 Complete the unshaded cells in Table 3 to show the result of the subroutine call F()
when it is applied using the graph shown in Figure 6.

Table 3

Value
Count returned

Copy the contents of the unshaded cells in Table 3 into the table in your Electronic
Answer Document.
[2 marks]

Question 4 continues on the next page

IB/G/Jun22/7517/1
8

Figure 7 shows a graph consisting of four nodes and the contents of the array
ConnectedNodes when it is used to represent this graph.

Figure 7

0 4 . 4 Complete the unshaded cells in Table 4 to show how the graph in Figure 7 would be
represented as an adjacency matrix.

Table 4

0 1 2 3

Copy the contents of the unshaded cells in Table 4 into the table in your Electronic
Answer Document.
[1 mark]

Figure 3 (repeated)

FUNCTION G(V, P)
Visited[V] True
FOR EACH N IN ConnectedNodes[V]
IF Visited[N] = False THEN
IF G(N, V) = True THEN
RETURN True
ENDIF
ELSE IF N P THEN
RETURN True
ENDIF
ENDFOR
RETURN False
ENDFUNCTION

IB/G/Jun22/7517/1
9

0 4 . 5 Complete the unshaded cells in Table 5 to show the result of the subroutine call
G(0, -1) on the graph shown in Figure 7. Some parts of the table, including the
initial values in the Visited array, have been completed for you.

Table 5

Visited
Subroutine
V P [0] [1] [2] [3] N
call
False False False False

G(0, -1)

Final value
returned:

Copy the contents of the unshaded cells in Table 5 into the table in your Electronic
Answer Document.
[6 marks]

0 4 . 6 What is the purpose of the subroutine G?


[1 mark]

0 4 . 7 State the type of graph traversal used in subroutine G.


[1 mark]

0 4 . 8 If the graph represented by ConnectedNodes is undirected, what can you


determine about the graph when a value of True is returned by subroutine E?
[1 mark]

Turn over for the next section

IB/G/Jun22/7517/1
10

Section B

You are advised to spend no more than 20 minutes on this section.

Enter your answers to Section B in your Electronic Answer Document.

You must save this document at regular intervals.

The question in this section asks you to write program code


starting from a new program/project/file.

You are advised to save your program at regular intervals.

0 5 Write a program that asks the user to enter a string. It should then change the order
of the vowels in the string and display the result.

If there are n vowels in the string, the 1st vowel in the string should swap with the nth
vowel in the string, the 2nd vowel in the string should swap with the (n-1)th vowel in
the string, and so on.

The letters a, e, i, o and u are the only vowels.

Examples

If the user enters the string horse then the program should display the
string herso.

If the user enters the string goose then the program should display the
string geoso.

If the user enters the string pinkfairyarmadillo then the


program should display the string ponkfiaryarmidalli.

If the user enters the string nakedmolerat then the program should
display the string nakedmolerat.

If the user enters the string lynx then the program should display the
string lynx.

If the user enters the string pig then the program should display the
string pig.

You may assume the string that the user enters will only contain lowercase letters.

IB/G/Jun22/7517/1
11

Evidence that you need to provide


Include the following evidence in your Electronic Answer Document.

0 5 . 1 Your PROGRAM SOURCE CODE.


[12 marks]

0 5 . 2 SCREEN CAPTURE(S) showing the results of three tests of the program by entering
the strings persepolis, darius and xerxes.
[1 mark]

Turn over for the next section

IB/G/Jun22/7517/1
Please write clearly in block capitals.

Centre number Candidate number

Surname

Forename(s)

Candidate signature
I declare this is my own work.

A-level
COMPUTER SCIENCE
Paper 2

Time allowed: 2 hours 30 minutes


Materials
For Examiner’s Use
For this paper you must have:
a calculator. Question Mark
1
Instructions
Use black ink or black ball-point pen. 2
Fill in the boxes at the top of this page. 3
Answer all questions.
4
You must answer the questions in the spaces provided. Do not write outside
the box around each page or on blank pages. 5
If you need extra space for your answer(s), use the lined pages at the end of 6
this book. Write the question number against your answer(s). 7
Do all rough work in this book. Cross through any work you do not want to
8
be marked.
9
Information 10
The marks for questions are shown in brackets.
11
The maximum mark for this paper is 100.
12
Advice 13
In some questions you are required to indicate your answer by completely
shading a lozenge alongside the appropriate answer as shown. TOTAL
If you want to change your answer you must cross out your original answer as
shown.
If you wish to return to an answer previously crossed out, ring the answer
you now wish to select as shown.

*JUN227517201*
IB/G/Jun22/E16 7517/2
2
Do not write
outside the
Answer all questions. box

0 1 . 1 Describe how a 12-bit unsigned binary integer such as 010010101110 can be


converted directly into hexadecimal.

The method you describe must not involve converting into decimal.
[2 marks]

0 1 . 2 State one reason why hexadecimal is often used in preference to binary.


[1 mark]

0 2 . 1 A data communications system uses parallel data transmission.

Describe how parallel data transmission works.


[2 marks]

*02*
IB/G/Jun22/7517/2
3
Do not write
outside the
0 2 . 2 State one advantage of serial data transmission over parallel data transmission. box

[1 mark]

0 2 . 3 Shade one lozenge to indicate which of these statements about data communications
systems is false.
[1 mark]

For a particular communications channel, the bit rate can be higher than
A
the baud rate.

B Latency is the rate at which signals on a wire or line can change.

The bandwidth of a transmission medium is the range of signal


C frequencies that the medium can transmit without a significant reduction
in signal strength.

The greater the bandwidth of a transmission medium the higher the bit
D
rate that can be achieved by a communication system using it.

0 2 . 4 State the purpose of the start bit in asynchronous serial transmission.


[1 mark]

0 2 . 5 State the purpose of the stop bit in asynchronous serial transmission.


[1 mark]

Turn over

*03*
IB/G/Jun22/7517/2
4
Do not write
outside the
0 3 . 1 Complete the truth table in Figure 1 for the inputs A and B. box

[1 mark]

Figure 1

+
0 0

0 1

1 0

1 1

0 3 . 2 The truth table in Figure 1 demonstrates the correctness of an important law in


Boolean algebra.

State the name of the law.


[1 mark]

*04*
IB/G/Jun22/7517/2
5
Do not write
outside the
0 3 . 3 Using the rules of Boolean algebra, simplify the following Boolean expression. box

A + B C + B C + C (A + A (B + 1))
You must show your working.
[4 marks]

Working

Answer 6

Turn over for the next question

Turn over

*05*
IB/G/Jun22/7517/2
6
Do not write
outside the
0 4 . 1 Define the term ‘system software’. box

[1 mark]

0 4 . 2 The list below contains five types of software. Four of the types are examples of
system software.

Shade one lozenge to indicate which type of software is not system software.
[1 mark]

A Assemblers

B Bitmap image editors

C Interpreters

D Libraries

E Utility programs

0 4 . 3 Describe two functions of an operating system.


[2 marks]

Function 1

Function 2

*06*
IB/G/Jun22/7517/2
7
Do not write
outside the
0 5 . 1 Figure 2 shows a number stored using a fixed point representation and two’s box

complement, with six bits before and four bits after the binary point.

Figure 2

1 0 1 1 0 0 1 0 1 1

Convert the number in Figure 2 to decimal.

You should show your working.


[2 marks]

Answer

0 5 . 2 State two reasons why values stored using a floating point representation are
usually stored in normalised form.
[2 marks]

Reason 1

Reason 2

Question 5 continues on the next page

Turn over

*07*
IB/G/Jun22/7517/2
8
Do not write
outside the
Questions 05.3, 05.4 and 05.5 use a normalised floating point representation with an box

8-bit mantissa and a 4-bit exponent, both stored using two’s complement.

0 5 . 3 Figure 3 shows a floating point representation of a number.

Figure 3

Calculate the decimal equivalent of the number.

Express your answer as a fraction or to 4 decimal places.

You should show your working.


[2 marks]

Answer

*08*
IB/G/Jun22/7517/2
9
Do not write
outside the
Questions 05.3, 05.4 and 05.5 use a normalised floating point representation with an box

8-bit mantissa and a 4-bit exponent, both stored using two’s complement.

0 5 . 4 Write the normalised floating point representation of the decimal value –23.25 in the
boxes below.

You should show your working.


[3 marks]

Answer

Question 5 continues on the next page

Turn over

*09*
IB/G/Jun22/7517/2
10
Do not write
outside the
Questions 05.3, 05.4 and 05.5 use a normalised floating point representation with an box

8-bit mantissa and a 4-bit exponent, both stored using two’s complement.

0 5 . 5 Figure 4 shows the closest possible representation of the decimal number


–0.22558594 in this floating point system.

Figure 4

By converting this number back to decimal it can be seen that the actual value stored
is –0.2265625

Calculate the relative error that has occurred when representing –0.22558594

You should show your working.

Express your answer as a percentage to 2 decimal places.


[2 marks]

Answer 11

*10*
IB/G/Jun22/7517/2
12
Do not write
outside the
0 6 Supermarkets often gather information about their customers and the purchases that box

they make. This information can be analysed by the supermarket and other
companies for a range of purposes.

Some of the information is collected at the checkout, where the identity of the person
is read from a loyalty or payment card using RFID (radio-frequency identification) and
a barcode reader is used to identify the products being purchased.

By analysing the purchases that a shopper has made, it might be possible to identify
such things as whether the shopper has children, is pregnant, or lives in a house with
a garden. Other types of analysis might include the amount of money a customer
spends, the times that they choose to shop at and the differences in shopping habits
of different groups of shoppers.

Describe the principles of operation of the hardware used to collect the information
and discuss some of the ethical and legal issues that might arise as a result of the
capture and processing of this data.

In your answer you will be assessed on your ability to follow a line of reasoning to
produce a coherent, relevant and structured response.
[12 marks]

*12*
IB/G/Jun22/7517/2
13
Do not write
outside the
box

12

Turn over

*13*
IB/G/Jun22/7517/2
14
Do not write
outside the
0 7 A network of zoos uses a relational database system to store information about the box

animals that they have so that they can be matched up with animals at other zoos in a
breeding programme.

Figure 5 shows the structure of the relations in the database.

Figure 5

Zoo(ZooName, Town, Country)


AnimalLocation(AnimalID, ZooName, DateArrived, DateLeft)
Animal(AnimalID, IndividualName, Species, DateOfBirth, Sex)
Match(AnimalFemaleID, AnimalMaleID, DateOfMatch, Successful)

The Zoo relation stores details of the zoos that participate in the breeding
programme. Each zoo is uniquely identified by its ZooName.
The AnimalLocation relation identifies which zoos each animal has lived at. The
zoo that the animal is currently at can be identified because the DateLeft attribute is
set to 01/01/0001 to indicate that the animal has not left.
The Animal relation stores details of the individual animals that are available to be
matched with other animals for breeding. Each animal is identified by a unique
number, the AnimalID. The individual name of the animal (eg ‘Timothy’) is also
stored, together with the species of the animal (eg ‘Red Panda’), its date of birth
and its sex (‘Male’ or ‘Female’).
The Match relation stores details of matches that have been made. The attributes
AnimalFemaleID and AnimalMaleID refer to the AnimalID values of the two
matched animals in the Animal relation.

0 7 . 1 Shade one lozenge to identify which of the properties below does not have to be
true for a fully normalised database.
[1 mark]

A Each attribute in a relation is dependent on the primary key.

Each attribute in a relation is dependent only on the primary key; it is not


B
also dependent on any other attribute in the relation.

C The primary key in each relation consists of only one attribute.

D There are no repeating groups (or equivalently each attribute is atomic).

*14*
IB/G/Jun22/7517/2
15
Do not write
outside the
0 7 . 2 Figure 6 is an incomplete entity-relationship diagram for part of the database shown box

in Figure 5.

Draw lines on Figure 6 to indicate the degree of the two relationships between the
three entities shown in the entity-relationship diagram.
[2 marks]

Figure 6

0 7 . 3 Complete the following SQL statement to create the Animal relation, including the key
field.
[3 marks]

CREATE TABLE Animal (

Question 7 continues on the next page

Turn over

*15*
IB/G/Jun22/7517/2
16
Do not write
outside the
0 7 . 4 Figure 5 is repeated below to help you answer Question 07.4 without having to turn box

back in the question paper.

Figure 5 (repeated)

Zoo(ZooName, Town, Country)


AnimalLocation(AnimalID, ZooName, DateArrived, DateLeft)
Animal(AnimalID, IndividualName, Species, DateOfBirth, Sex)
Match(AnimalFemaleID, AnimalMaleID, DateOfMatch, Successful)

There is a requirement to identify all of the red pandas that were present at the zoo
called ‘Ashdale Park’ at any time between 01/04/2020 and 31/05/2020, inclusive.

The animals might still be at the zoo or may have moved to another zoo.

Write a query that will list all the red pandas that were at the zoo on any day between
these dates.

For each red panda on the list, the animal’s individual name and the date that the
animal arrived at the zoo, and no other fields, should be listed.
[7 marks]

*16*
IB/G/Jun22/7517/2
17
Do not write
outside the
box

0 7 . 5 It is proposed that an additional attribute, ZooName, is added to the Animal relation.


This will store the name of the zoo that currently has the animal. No other changes
would be made to the database.

Describe one advantage and one disadvantage of adding this new attribute to the
relation.
[2 marks]

Advantage

Disadvantage

15

Turn over for the next question

Turn over

*17*
IB/G/Jun22/7517/2
18
Do not write
outside the
0 8 A student is setting up a small computer network in their house. The network will link box

together the laptops, desktop computers and mobile devices that belong to the people
who live in the house.

0 8 . 1 Compare how peer-to-peer networking and client-server networking work.


[3 marks]

0 8 . 2 Explain why a peer-to-peer system would be most appropriate to use in the house.
[3 marks]

*18*
IB/G/Jun22/7517/2
19
Do not write
outside the
box

0 8 . 3 When a person in the house uses the network to load a webpage it is likely that the
Domain Name Server (DNS) system will be used.

Describe the main purpose of the DNS system and how it works.
[3 marks]

Turn over for the next question

Turn over

*19*
IB/G/Jun22/7517/2
20
Do not write
This table is included so that you can answer Questions 09.1 and 09.2 on page 21. outside the
box

Table 1 – Standard AQA assembly language instruction set

LDR Rd, <memory ref> Load the value stored in the memory location specified by
<memory ref> into register d.
STR Rd, <memory ref> Store the value that is in register d into the memory location
specified by <memory ref>.
ADD Rd, Rn, <operand2> Add the value specified in <operand2> to the value in
register n and store the result in register d.
SUB Rd, Rn, <operand2> Subtract the value specified by <operand2> from the value
in register n and store the result in register d.
MOV Rd, <operand2> Copy the value specified by <operand2> into register d.
CMP Rn, <operand2> Compare the value stored in register n with the value
specified by <operand2>.
B <label> Always branch to the instruction at position <label> in the
program.
B <condition> <label> Branch to the instruction at position <label> if the last
comparison met the criterion specified by <condition>.
Possible values for <condition> and their meanings are:
EQ: equal to NE: not equal to
GT: greater than LT: less than
AND Rd, Rn, <operand2> Perform a bitwise logical AND operation between the value
in register n and the value specified by <operand2> and
store the result in register d.
ORR Rd, Rn, <operand2> Perform a bitwise logical OR operation between the value in
register n and the value specified by <operand2> and
store the result in register d.
EOR Rd, Rn, <operand2> Perform a bitwise logical XOR (exclusive or) operation
between the value in register n and the value specified by
<operand2> and store the result in register d.
MVN Rd, <operand2> Perform a bitwise logical NOT operation on the value
specified by <operand2> and store the result in register d.
LSL Rd, Rn, <operand2> Logically shift left the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
LSR Rd, Rn, <operand2> Logically shift right the value stored in register n by the
number of bits specified by <operand2> and store the
result in register d.
HALT Stops the execution of the program.
Labels: A label is placed in the code by writing an identifier followed by a colon (:). To refer to a
label the identifier of the label is placed after the branch instruction.

Interpretation of <operand2>
<operand2> can be interpreted in two different ways, depending on whether the first character
is a # or an R:

# – use the decimal value specified after the #, eg #25 means use the decimal value 25
Rm – use the value stored in register m, eg R6 means use the value stored in register 6

The available general-purpose registers that the programmer can use are numbered 0–12

*20*
IB/G/Jun22/7517/2
21
Do not write
outside the
0 9 Figure 7 shows an assembly language program that has been written using the AQA box

Assembly Language Instruction Set, which is given in Table 1 on page 20.

Figure 7

LDR R0, 120


LDR R1, 121
MOV R3, #0
loop:
CMP R1, #0
BEQ exit
AND R2, R1, #1
CMP R2, #0
BEQ skip
ADD R3, R3, R0
skip:
LSL R0, R0, #1
LSR R1, R1, #1
B loop
exit:
STR R3, 122
HALT

0 9 . 1 State the name of the addressing mode used in the instruction ADD R3, R3, R0
[1 mark]

0 9 . 2 Memory location 120 contains the value 23 and memory location 121 contains the
value 5.

Complete the trace table to show how the contents of the memory locations and
registers change when the program in Figure 7 is executed.
[5 marks]
Memory locations Registers
120 121 122 R0 R1 R2 R3
23 5

Turn over

*21*
IB/G/Jun22/7517/2
22
Do not write
outside the
0 9 . 3 State the purpose of the program in Figure 7. box

[1 mark]

0 9 . 4 The program in Figure 7 has been written using assembly language.

State two reasons why the programmer may have chosen to write this program in
assembly language rather than in a high-level programming language.
[2 marks]

Reason 1

Reason 2

0 9 . 5 The program in Figure 7 will be translated into machine code.

Explain the relationship between an assembly language instruction and a machine


code instruction.
[1 mark]

10

*22*
IB/G/Jun22/7517/2
23
Do not write
outside the
1 0 . 1 A digital recording was made using a sampling rate of 44 100 Hz with a 16-bit sample box

resolution.

A sampling rate of 1 Hz means that one sample has been taken every second.

The file, which stores only the recording, is 17.199 megabytes in size.

Calculate the duration of the recording in seconds.

You should show your working.


[3 marks]

Answer seconds

Question 10 continues on the next page

Turn over

*23*
IB/G/Jun22/7517/2
24
Do not write
outside the
1 0 . 2 MIDI is a system that can be used to enable musical devices to communicate and to box

represent music on a computer.

Describe the advantages of using MIDI to represent music instead of using sampled
sound.
[3 marks]

1 1 Compare the hardware requirements of thin-client and thick-client computing systems.


[3 marks]

*24*
IB/G/Jun22/7517/2
26
Do not write
outside the
1 2 In a functional programming language, six functions named fu, fv, fw, fx, fy and box

fz and a list of temperatures in Fahrenheit named temps are defined as shown in


Figure 8.

Figure 8

temps = [50, 68, 95, 86]


fu a = (a - 32) * 5 / 9
fv b = map fu b
fw [] = 0
fw (x:xs) = 1 + fw (xs)
fx [] = 0
fx (x:xs) = x + fx (xs)
fy c = fx (c) / fw (c)
fz d = fy (fv (d))

A temperature can be converted from degrees Fahrenheit to degrees centigrade using


the following method:

5
centigrade = (Fahrenheit – 32) ×
9

For example, 59 degrees Fahrenheit is equivalent to 15 degrees centigrade.

In the functions fw and fx:

[] is the empty list


(x:xs) lets the function definition refer to the head of the list as x and the tail
as xs.

1 2 . 1 Shade one lozenge to indicate which of the listed functions from Figure 8 includes a
higher-order function in its definition.
[1 mark]

fu fv fx fy

1 2 . 2 Shade two lozenges to indicate which of the listed functions from Figure 8 use
recursion in their definitions.
[1 mark]

fu fv fw fx

*26*
IB/G/Jun22/7517/2
27
Do not write
outside the
box

1 2 . 3 Calculate the results of making the function calls listed in Table 2, using the functions
and list in Figure 8 as appropriate.
[4 marks]
Table 2

Function call Result

fu 50

fv temps

fw temps

fz temps

1 2 . 4 Explain the purpose of the function fz.


[1 mark]

1 2 . 5 It is proposed that the definition of the function fz is changed to:

fz d = fu (fy (d))

Explain why this new definition of fz could be considered to be an improvement over


the definition of fz in Figure 8.
[1 mark]

Turn over for the next question

Turn over

*27*
IB/G/Jun22/7517/2
28
Do not write
outside the
1 3 . 1 Below is a definition of a term relating to the architecture of a computer system: box

Machine code instructions stored in main memory are fetched and


executed serially by a processor that performs arithmetic and logical
operations.

Shade one lozenge to indicate which term this defines.


[1 mark]

A The Harvard architecture

B The processor instruction set

C The stored program concept

D The von Neumann architecture

1 3 . 2 Explain why desktop computers usually have secondary storage devices.


[2 marks]

*28*
IB/G/Jun22/7517/2
29
Do not write
outside the
1 3 . 3 A computer is fitted with a solid-state disk (SSD). box

Describe the principles of operation of an SSD.


[4 marks]

END OF QUESTIONS

*29*
IB/G/Jun22/7517/2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy