A Level Cs PPQ Merged Booklet 23-24
A Level Cs PPQ Merged Booklet 23-24
AQA A LEVEL
2023-24
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
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
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.
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]
[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
Complete Table 1 and copy the table into the Electronic Answer Document.
0 2 . 1
Table 1
[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.
[3 marks]
Turn over
4
Figure 2 shows an attempt to write a set of BNF production rules to define a language
of full names.
Figure 2
Rule
number
1 <fullname> ::= <title>_<name>_<endtitle> |
<name> |
<title>_<name> |
<name>_<endtitle>
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
[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
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
[1 mark]
Complete Table 3 and copy the table into the Electronic Answer Document.
[2 marks]
Table 3
Table 4 shows how the graph in Figure 3 can be represented as an adjacency matrix.
Table 4
Turn over
8
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
[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
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.
[2 marks]
[2 marks]
Turn over
10
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.
[1 mark]
[1 mark]
[2 marks]
11
Table 6
Order of time
complexity
O(1)
O(n2)
O(log n)
O(kn)
O(n)
[1 mark]
[1 mark]
[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]
[1 mark]
END OF SECTION A
Section B
The question in this section asks you to write program code starting from a new
program/project/file.
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
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.
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
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
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]
Write the letter corresponding to the correct answer in the box provided in your
Electronic Answer Document.
[1 mark]
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
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"].
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.
Table 1
[6 marks]
5
0 2 . 4 What is the time complexity for the MergeSort algorithm shown in Figure 1?
[1 mark]
0 2 . 5 State two items that will be stored in a stack frame for a subroutine call.
[2 marks]
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]
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]
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.
Client = Class {
Private:
Name: String
Address: Location
DOB: Date
Public:
Function GetName
Function GetDOB
Function GetAddress
Procedure SetDetails
}
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
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 . 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.
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]
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.
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
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.
Surname
Forename(s)
Candidate signature
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
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]
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 . 4 Explain how it is possible for the bit rate to be higher than the baud rate.
[1 mark]
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.
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 . 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.
[3 marks]
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]
12
Figure 2
Row
1
10
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]
0 5 . 3 Calculate the number of bytes required to represent all the pixel data in the icon as a
bitmap.
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
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]
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]
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
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]
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:
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.
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 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
0 7 . 2 State one advantage of the star topology over the bus topology, and explain how this
is achieved.
[2 marks]
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.
Each packet of data transmitted around the LAN includes a checksum, which is used
for error detection.
13
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.
Table 3
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
Mantissa Exponent
Mantissa Exponent
0 8 . 4 Explain the effects of using the proposed alternative representation instead of the
existing representation.
[2 marks]
10
The details of the track events are stored using the three relations in Figure 7.
Figure 7
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
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
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
0 9 . 4 Write the SQL commands that are required to make this entry.
[2 marks]
Figure 7 (repeated)
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]
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.
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
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
A B A B
A 1 1
A ( A B) A
A ( A B) B
A 1 1
A B B A
Answer:
6
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
Table 7
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
A-level
COMPUTER SCIENCE
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
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
-64
10
5/128
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 . 7 State two reasons why the Unicode character coding system was introduced as an
alternative to ASCII.
[2 marks]
Reason 1
Reason 2
Figure 1
Architecture A Architecture B
Instruction
Memory
Memory
Processor Processor
Data
Memory
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]
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 4 ___________________________________________________
4
___________________________________________________
11
Figure 3
A
Router Switch
Internet
Combined Device
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]
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]
13
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
0 6 . 1 Write the SQL instructions that are required to create the Member table.
[3 marks]
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]
The SQL query from part 0 6 . 2 is executed on the server and finds the
following two records:
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>
Advantage 1
Advantage 2
11
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
Explain why functional programming is one appropriate method to use when this is the
case.
[2 marks]
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
DOUBLE (x) = 2 * x
SQUARE (x) = x * x
[1 mark]
[2 marks]
Discuss the ethical, legal and cultural issues that the developers will face when setting
up and running the service.
[9 marks]
Figure 7
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
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]
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]
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.
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
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
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.
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 . 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
Turn over ►
IB/M/Jun17/7517/1
6
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
IB/M/Jun17/7517/1
7
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 ►
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 4
Norbert
Judith Phil
Figure 5
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.
IB/M/Jun17/7517/1
9
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
TreeSearch(Olivia, Norbert)
Copy the contents of the unshaded cells in Table 3 into the table in your
Electronic Answer Document.
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].
IB/M/Jun17/7517/1
11
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:
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 . 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]
u.v
EnemyCanSee
Copy the contents of the unshaded cells in Table 4 into the table in your
Electronic Answer Document.
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.
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 ►
IB/M/Jun17/7517/1
14
Section B
The question in this section asks you to write program code starting from a new
program/project/file.
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
Figure 10
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
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 ►
IB/M/Jun17/7517/1
Please write clearly in block capitals.
Surname
Forename(s)
Candidate signature
A-level
COMPUTER SCIENCE
Paper 2
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
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
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.
Turn over ►
*03*
IB/M/Jun17/7517/2
Do not write
4 outside the
box
Figure 2
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.
4
Turn over for the next question
Turn over ►
*05*
IB/M/Jun17/7517/2
Do not write
6 outside the
box
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]
Figure 3 shows three suggested relationships between bandwidth and bit rate.
Figure 3
*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.
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:
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]
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
Answer
Turn over ►
*09*
IB/M/Jun17/7517/2
Do not write
10 outside the
box
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]
Turn over ►
*11*
IB/M/Jun17/7517/2
Do not write
12 outside the
box
The assembly language instruction set that has been used to write the program is
listed in Table 1 on the next page.
Figure 5
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]
*12*
IB/M/Jun17/7517/2
Do not write
13 outside the
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.
Turn over ►
*13*
IB/M/Jun17/7517/2
Do not write
14 outside the
box
11
*14*
IB/M/Jun17/7517/2
Do not write
15 outside the
box
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
filter (<10) b
fold (+) 0 c
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 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
Sound is being sampled using a 16-bit sample resolution and a sample rate
of 20 000 Hz.
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.
Answer
*18*
IB/M/Jun17/7517/2
Do not write
19 outside the
box
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
*20*
IB/M/Jun17/7517/2
Do not write
21 outside the
box
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
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]
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
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 (repeated)
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.
*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
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 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
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.
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.
*28*
IB/M/Jun17/7517/2
A-level
COMPUTER SCIENCE
Paper 1
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.
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
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]
Use the space below for rough working then copy your answer into your
Electronic Answer Document.
[2 marks]
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.
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.
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 . 3 State one reason why the graph shown in Figure 1 is not a tree.
[1 mark]
Turn over ►
IB/M/Jun18/7517/1
8
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 . 7 The contents of the array P were changed by the algorithm. What is the purpose
of the array P?
[2 marks]
Turn over ►
IB/M/Jun18/7517/1
10
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.
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
The question in this section asks you to write program code starting from a new
program/project/file.
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:
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.
[1 mark]
Turn over ►
IB/M/Jun18/7517/1
Please write clearly in block capitals.
Surname
Forename(s)
Candidate signature
A-level
COMPUTER SCIENCE
Paper 2
*jun187517201*
IB/M/Jun18/E10 7517/2
2
Do not write
Answer all questions. outside the
box
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.
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 ►
*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.
Each image uses four colours: white, black, yellow and blue.
Figure 1 Figure 2
[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.
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]
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=
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.
Explain how the performance of the system might be improved. You should consider
the following factors that might be affecting the performance:
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 ►
*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
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:
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).
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
• 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.
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
You may assume that all of the data types used in Figure 9 are valid and the field
lengths are appropriate.
[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 (repeated)
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.
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]
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
𝝅𝝅
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
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]
� )� = A ∙ C + B
(A + B) ∙ �B + C ∙ (D + D
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.
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.
*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 ►
*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
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.
*20*
IB/M/Jun18/7517/2
21
Do not write
outside the
Figure 13 box
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 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:
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 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 ►
*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)
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
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
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.
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
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.’
IB/M/Jun19/7517/1
3
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 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
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
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
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]
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 . 3 Complete Table 2 to show which of the strings belong to the language defined by the
regular expression 1|01+.
Table 2
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
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.
[1 mark]
Surname
Forename(s)
Candidate signature
A-level
COMPUTER SCIENCE
Paper 2
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
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]
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.
Explain the key difference between lossless and lossy compression methods.
[1 mark]
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
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
The columns in the addition have been labelled A to H to help you make your
explanation clear.
[1 mark]
Describe the steps that must be completed to translate and execute the program.
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 ►
*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 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.
Each vet is associated with one surgery which they work at; each surgery is staffed by
several vets.
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
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]
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
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.
*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 ►
*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 ℤ × ℤ.
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]
Q = �������������
A. B + C. B �
[4 marks]
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
0 8 . 4 Using the rules of Boolean algebra, simplify the following Boolean expression.
���������
������
� .A.B � + A.B
B
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 . 2 The ASCII code for the digit '0' is 48 in decimal. In ASCII, other digits follow on from
this value in sequence.
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
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
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
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.
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 0 1 1 0 0 1 0 0 0 1 0
Mantissa Exponent
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.
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
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.
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]
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
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
Decrypt the ciphertext to work out what the original plaintext message was.
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 . 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
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
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.
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
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 . 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.
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 ►
IB/G/Jun20/7517/1
4
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
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
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
drank a human
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.
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.
Turn over ►
IB/G/Jun20/7517/1
6
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.
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 . 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 ►
IB/G/Jun20/7517/1
8
Section B
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.
IB/G/Jun20/7517/1
Please write clearly in block capitals.
Surname
Forename(s)
Candidate signature
I declare this is my own work.
A-level
COMPUTER SCIENCE
Paper 2
*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.
Answer
0 1 . 2 An analogue to digital converter (ADC) was used during the sampling process.
*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.
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]
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.
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.
0 2 . 5 When the decimal value 28.25 is converted into binary using this floating point
system, a rounding error occurs.
Explain:
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
Address Bus
Data Bus
Main Memory
Processor
*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
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]
*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]
12
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
• 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.
REST allows JavaScript to communicate with the server using the HTTP
B
protocol.
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
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>
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
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
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:
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
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.
*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]
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
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
Figure 6
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
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]
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.
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 ►
*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.
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
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
0 8 . 2 Explain why the product manufacturers or supermarket owners might prefer the
individual products to be identified using barcode labels.
[2 marks]
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
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.
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
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)
Figure 13
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 ►
*33*
IB/G/Jun20/7517/2
34
Do not write
outside the
1 1 . 1 The list towers is defined as: box
Head
Tail
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:
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.
END OF QUESTIONS
*35*
IB/G/Jun20/7517/2
A-level
COMPUTER SCIENCE
Paper 1
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.
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
IB/G/Jun21/7517/1
3
Section A
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.
Table 1
Copy the contents of the unshaded cells in Table 1 into the table in your Electronic
Answer Document.
[3 marks]
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
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.
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.
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.
IB/G/Jun21/7517/1
7
0 5 . 1 State two advantages of using Reverse Polish Notation (RPN) instead of infix notation
to represent an expression.
[2 marks]
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
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
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
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.
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.
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
*JUN217517201*
IB/G/Jun21/E17 7517/2
2
Do not write
outside the
Answer all questions. box
Calculate the maximum number of different colours that could appear in the image.
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
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 ►
*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
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 ►
*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
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
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]
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 ►
*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
• 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:
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]
*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:
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]
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
Figure 3 (repeated)
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 ►
*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
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
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)
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
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 ►
*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
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.
Table 2
*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
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
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
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
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
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]
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
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
Describe:
END OF QUESTIONS
*32*
IB/G/Jun21/7517/2
A-level
COMPUTER SCIENCE
Paper 1
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.
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
State the Big-O time complexity of each of these algorithms. The first row has been
completed for you.
Table 1
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]
Figure 1 shows data that has been stored in a stack implemented using an array S.
Figure 1
[7]
[6]
[5]
[4]
[3]
[1] Skye
[0] Harry
0 2 . 5 Explain how a single stack can be used to reverse the order of the items in a queue.
[2 marks]
IB/G/Jun22/7517/1
4
Figure 2
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.
Copy the contents of the unshaded cells in Table 2 into the table in your Electronic
Answer Document.
[2 marks]
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
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
FUNCTION F()
FOR Count 0 TO LENGTH(Visited) - 1
IF Visited[Count] = False THEN
RETURN False
ENDIF
ENDFOR
RETURN True
ENDFUNCTION
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]
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]
IB/G/Jun22/7517/1
10
Section B
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.
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 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
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]
IB/G/Jun22/7517/1
Please write clearly in block capitals.
Surname
Forename(s)
Candidate signature
I declare this is my own work.
A-level
COMPUTER SCIENCE
Paper 2
*JUN227517201*
IB/G/Jun22/E16 7517/2
2
Do not write
outside the
Answer all questions. box
The method you describe must not involve converting into decimal.
[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.
The greater the bandwidth of a transmission medium the higher the bit
D
rate that can be achieved by a communication system using it.
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
*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
*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
C Interpreters
D Libraries
E Utility programs
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
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
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.
Figure 3
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.
Answer
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.
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
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
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]
*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]
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
Figure 5 (repeated)
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
Describe one advantage and one disadvantage of adding this new attribute to the
relation.
[2 marks]
Advantage
Disadvantage
15
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 . 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
*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
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
Figure 7
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]
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
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.
Answer seconds
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
Describe the advantages of using MIDI to represent music instead of using sampled
sound.
[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
Figure 8
5
centigrade = (Fahrenheit – 32) ×
9
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
fu 50
fv temps
fw temps
fz temps
fz d = fu (fy (d))
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
*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
END OF QUESTIONS
*29*
IB/G/Jun22/7517/2