Aqa Comp3 QP Jun14
Aqa Comp3 QP Jun14
Aqa Comp3 QP Jun14
Candidate Number
Surname
Other Names
Examiners Initials
Candidate Signature
Question
Mark
1
2
3
Computing
Unit 3
COMP3
5
6
7
9.00 am to 11.30 am
Time allowed
2 hours 30 minutes
10
Instructions
Use black ink or black ball-point pen.
Fill in the boxes at the top of this page.
Answer all questions.
You must answer the questions in the spaces provided. Do not write
outside the box around each page or on blank pages.
All working must be shown.
Do all rough work in this book. Cross through any work you do not
want to be marked.
TOTAL
Information
The marks for questions are shown in brackets.
The maximum mark for this paper is 100.
The use of brand names will not gain credit.
Question 7(b) should be answered in continuous prose. In this question
you will be marked on your ability to:
use good English
organise information clearly
use specialist vocabulary where appropriate.
(JUN14COMP301)
M/AH/102127/Jun14/E6
COMP3
Do not write
outside the
box
1 (a)
For each row in Table 1, place a tick in one column to indicate whether the
transmission is most likely to be serial, most likely to be parallel or could be either serial
or parallel.
[3 marks]
Table 1
Situation
Most likely
to be
Parallel
Most likely
to be
Serial
Sending data to a
peripheral, such as a
printer, that is plugged
directly into a computer.
Transferring memory
addresses between the
processor and the main
memory of a desktop
computer.
Transmitting an email
across a WAN from a
computer in England to an
email server in Scotland.
1 (b)
(02)
M/Jun14/COMP3
Do not write
outside the
box
3
1 (c)
When data is transmitted over long distances, eg via satellites, latency can become a
problem.
Explain what latency is.
[1 mark]
............................................................................................................................................
............................................................................................................................................
____
5
2 (a)
For each of the following regular expressions, describe the set of strings that they
would match.
2 (a) (i)
b*c
[1 mark]
............................................................................................................................................
............................................................................................................................................
[1 mark]
............................................................................................................................................
............................................................................................................................................
2 (b)
Write a regular expression that matches the letter b, followed by zero or more
occurrences of the string cd followed by either a single letter e or the string fg.
[2 marks]
............................................................................................................................................
............................................................................................................................................
____
4
(03)
M/Jun14/COMP3
Do not write
outside the
box
A computer program stores a list of integers in an array named List. The numbers
in the array are to be sorted into ascending order so that a particular efficient search
algorithm can be used to search for a number.
3 (a)
One of the search algorithms in Table 2 can only be used successfully on a sorted list.
Place one tick next to the name of the algorithm that requires a list to be sorted.
[1 mark]
Table 2
Algorithm Name
Binary search
Linear search
3 (b)
The pseudo-code for a standard algorithm that can be used to sort the data in the array
List into order is shown in Figure 1. The variable ListLength stores a count of
the number of items in the array List.
Array indexing starts at 1.
Figure 1
(04)
M/Jun14/COMP3
Do not write
outside the
box
5
Complete the empty (unshaded) cells in the trace table (Table 3) for an execution of
the algorithm in Figure 1 when the array List contains the values 9, 8, 5 and 6 in
that order.
[3 marks]
Table 3
List
List
Length
Outer
Pointer
Current
Value
Inner
Pointer
[1]
[2]
[3]
[4]
1
0
2
1
0
3
2
1
3 (c)
In the trace table (Table 3), when the variable OuterPointer contains the
value 2 and then 3, the value of the variable InnerPointer decreases to 0. When
OuterPointer contains 4, InnerPointer stops decreasing when it reaches the
number 1.
Explain why InnerPointer does not decrease to 0 when OuterPointer
contains 4.
[1 mark]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
Turn over
(05)
M/Jun14/COMP3
6
3 (d)
Do not write
outside the
box
Tick one box in Table 4 to indicate the correct Order of Time Complexity of the
standard algorithm in Figure 1.
[1 mark]
Table 4
Order of Time Complexity
O(n)
O(n2)
O(2n)
3 (e)
State the name of the standard algorithm that is represented by the pseudo-code in
Figure 1.
[1 mark]
............................................................................................................................................
3 (f)
Instead of storing a list of numbers in an array as in 3(b), the numbers could be stored
in a binary search tree. This would also enable efficient searching.
The numbers 9, 6, 1, 8, 20 and 10 are put into a binary search tree in that order.
Figure 2 shows this binary search tree.
Figure 2
9
(06)
20
10
M/Jun14/COMP3
Do not write
outside the
box
7
3 (f) (i)
3 (f) (ii) A search of the binary tree is performed for the number 11.
List the numbers, in the order that they would be checked, for the search to determine
that the number 11 is not present in the tree.
[1 mark]
............................................................................................................................................
3 (g)
The numbers 4, 5 and 3 are to be added into the binary search tree, in that order.
Figure 3 below is an identical copy of Figure 2.
Complete Figure 3 below to show the binary search tree from Figure 2 after the extra
numbers have been added into it.
[2 marks]
Figure 3
9
20
10
____
11
Turn over
(07)
M/Jun14/COMP3
Do not write
outside the
box
A normalised floating point representation uses an 8-bit mantissa and a 4-bit exponent,
both stored using twos complement format.
4 (a)
In binary, write the largest positive number that can be represented using this
normalised floating point system in the boxes below:
[2 marks]
Mantissa
4 (b)
Exponent
Mantissa
Exponent
Calculate the denary equivalent of the number. Show how you have arrived at your
answer.
Working ..............................................................................................................................
............................................................................................................................................
............................................................................................................................................
[1 mark]
Answer ...............................................................................................................................
[1 mark]
(08)
M/Jun14/COMP3
Do not write
outside the
box
9
4 (c)
Mantissa
Exponent
Calculate the denary equivalent of the number. Show how you have arrived at your
answer.
Working ..............................................................................................................................
............................................................................................................................................
............................................................................................................................................
[1 mark]
Answer ...............................................................................................................................
[1 mark]
4 (d)
Write the normalised floating point representation of the negative denary value -108 in
the boxes below. Show how you have arrived at your answer.
Working ..............................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
[2 marks]
Answer
Mantissa
Exponent
[1 mark]
Turn over
(09)
M/Jun14/COMP3
10
4 (e) (i)
Do not write
outside the
box
4 (e) (ii) Table 5 below contains descriptions of operations which may or may not cause an
overflow error when they are carried out with a floating point representation.
Place one tick next to the operation that may cause overflow.
[1 mark]
Table 5
Operation
____
12
(10)
M/Jun14/COMP3
Do not write
outside the
box
11
Turn over for the next question
Turn over
(11)
M/Jun14/COMP3
12
5
Do not write
outside the
box
5 (a)
Explain why a queue is a suitable data structure to represent the deck of cards in this
game.
[1 mark]
............................................................................................................................................
............................................................................................................................................
5 (b)
The queue representing the deck of cards will be implemented as a circular queue in a
fixed size array named DeckQueue. The array DeckQueue has indices running from
1 to 52.
Figure 4 shows the contents of the DeckQueue array and its associated pointers at
the start of a game. The variable QueueSize indicates how many cards are
currently represented in the queue.
Figure 4
DeckQueue
Index
(12)
Data
[1]
10-Hearts
[2]
2-Spades
[3]
King-Hearts
[4]
.
.
.
Ace-Clubs
[52]
8-Diamonds
FrontPointer = 1
RearPointer = 52
QueueSize = 52
M/Jun14/COMP3
Do not write
outside the
box
13
5 (b) (i)
FrontPointer = ..............
RearPointer = ..............
QueueSize = ..............
5 (b) (ii) Next, a player gives up two cards and these are returned to the deck.
What values are now stored in the FrontPointer and RearPointer pointers and
the QueueSize variable?
[1 mark]
FrontPointer = ..............
RearPointer = ..............
QueueSize = ..............
5 (b) (iii) Write a pseudo-code algorithm to deal a card from the deck.
Your algorithm should output the value of the card that is to be dealt and make any
required modifications to the pointers and to the QueueSize variable.
It should also cope appropriately with any situation that might arise in the DeckQueue
array whilst a game is being played.
[6 marks]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
Turn over
(13)
M/Jun14/COMP3
14
5 (c)
Do not write
outside the
box
5 (d)
The card game program will interact with the operating system on the smartphone.
Describe two differences between the operating system that is installed on the
smartphone and an operating system that would be used on a desktop computer.
[2 marks]
Difference 1 ........................................................................................................................
............................................................................................................................................
............................................................................................................................................
Difference 2 ........................................................................................................................
............................................................................................................................................
............................................................................................................................................
____
13
(14)
M/Jun14/COMP3
Do not write
outside the
box
15
Turn over for the next question
Turn over
(15)
M/Jun14/COMP3
16
6
Do not write
outside the
box
A government agency is responsible for storing information about vehicles and their
owners. Each vehicle that is driven must be registered with this agency. Vehicles
must be insured to be driven, so the agency also keeps a record of vehicle insurance
policies.
Details of the vehicles, owners and insurance policies are stored in a relational
database using the following three relations:
Complete the following Data Definition Language (DDL) statement to create the
Insurance table, including the key field.
[3 marks]
(16)
M/Jun14/COMP3
Do not write
outside the
box
17
6 (b)
The owner of the vehicle with registration number DF24JUT has had his car repainted
so that its colour is now pink.
Complete this SQL statement to update the data in the Vehicle table to reflect this
change.
[2 marks]
UPDATE ..............................................................................................................................
SET .....................................................................................................................................
WHERE ................................................................................................................................
6 (c)
A police officer is following a car with registration number AB72XHC. She wants to use
the computerised system to check some details about the car and its owner.
Write an SQL query that could be used to retrieve the Model and Colour of the car and
the Forename and Surname of the cars owner.
[4 marks]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
Turn over
(17)
M/Jun14/COMP3
18
6 (d)
Do not write
outside the
box
The police officer requests the information using a hand held terminal that connects to
the Internet. She types the vehicle registration number into a form on a secure web
page and the details about the car and owner are then displayed in the web browser on
the terminal.
A server-side script is used to search for the required information.
6 (d) (i)
RegNo = Request("RegistrationNumber")
Explain what this statement does when executed.
[2 marks]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
6 (d) (iii) The server-side script includes the statement:
(18)
M/Jun14/COMP3
Do not write
outside the
box
19
The definitions of the three relations in the database on page 16 are repeated
here so that you can answer Question 6 (e) on this page without having to turn
back in the question booklet.
6 (e)
____
18
(19)
M/Jun14/COMP3
20
7
Do not write
outside the
box
(20)
M/Jun14/COMP3
Do not write
outside the
box
21
Figure 6 is a map of part of the underground railway network, showing the same ten
stations. This map does not show the streets above ground but instead shows the
underground railway lines that connect the stations together.
Figure 6
Turn over
(21)
M/Jun14/COMP3
22
7 (a)
Do not write
outside the
box
7 (b)
h
ow
Your implementation should store all the details that are required to calculate the
shortest distance between any two stations, but you do not need to describe how the
shortest distance would be worked out.
In your answer you will be assessed on your ability to use good English, and to
organise your answer clearly in complete sentences, using specialist vocabulary where
appropriate.
You may use diagrams to help clarify your description, but as you are being assessed
on your ability to use good English, you must ensure that all diagrams are fully
explained.
[8 marks]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
(22)
M/Jun14/COMP3
Do not write
outside the
box
23
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
____
9
Turn over
(23)
M/Jun14/COMP3
24
Do not write
outside the
box
8 (a)
(24)
M/Jun14/COMP3
Do not write
outside the
box
25
8 (b)
One GUI component is a Selector. Selectors come in two different types: ComboBox
and ListBox.
Selector Type Description
ComboBox
A combo box lets the user make an input either by typing into
the box or by picking a single item from a list.
ListBox
A list box lets the user select options from a list. The user
cannot type into a list box. There are two different types of list
box:
SingleSelectionListBox: The user can only select one
item from a list. Whenever an item is selected, the
previously selected item is deselected.
MultipleSelectionListBox: The user can select one or
more items from a list. Whenever an item is selected, it is
added to the list of selected items.
(25)
M/Jun14/COMP3
26
8 (c)
Do not write
outside the
box
an array that stores the list of strings that will appear in the selector.
N
umberOfItemsInList: a number that indicates how many items there are in the
selector.
It also has a procedure that the programmer can call to add an item to the list of
strings (AddItemToList) and a procedure that is called by the operating system
whenever the user selects an item from the list (SelectItemFromList).
The Selector class does not include a procedure to display the items in the list as the
way items are displayed is different for each type of selector.
The class definition for Selector is:
Selector = Class
Public
Procedure AddItemToList
Procedure SelectItemFromList
Private
Items: Array of String
NumberOfItemsInList: Integer
End
A class is to be created for the ComboBox type of selector.
The ComboBox class needs the following additional data fields:
T
extTyped:
Stores the characters that have been typed by the user if they have
made their input by typing rather than picking an option from the list.
S
electedItemNumber: Stores the position in the list of the item that has been
selected by the user, if one has been selected.
A
llowNonListInputs: A True or False value that indicates whether the user should
be allowed to type in text that is not one of the items in the list.
The class will need to implement the operation of selecting an item from the list
differently from the way the Selector class implements this operation, but the operation
of adding an item to the list will be implemented in the same way by both of these
classes.
The class must provide subroutines to:
display
(26)
M/Jun14/COMP3
Do not write
outside the
box
27
Write the class definition for the ComboBox class.
[5 marks]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
____
9
Turn over
(27)
M/Jun14/COMP3
28
9
Do not write
outside the
box
(SB, 0) = (S0 , , )
means:
IF
the machine is currently in state SB AND the input symbol read from the
tape is 0
THEN
the machine should change to state S0, write a blank symbol () to the tape
and move the read/write head one cell to the right
(28)
(SB, 0) =
(SB, 1) =
(SB, ) =
(S0, , )
(S1, , )
(SY, , )
(SC0, 0) = (SL, ,)
(SC0, 1) = (SN, 1,)
(SC0, ) = (SY, ,)
(S0, 0) =
(S0, 1) =
(S0, ) =
(S0, 0, )
(S0, 1, )
(SC0, ,)
(S1, 0) =
(S1, 1) =
(S1, ) =
(S1, 0, )
(S1, 1, )
(SC1, ,)
M/Jun14/COMP3
Do not write
outside the
box
29
9 (a)
This Turing machine is carrying out a computation. The machine starts in state SB with
the string 101 on the tape. All other cells contain the blank symbol, (not shown).
The read/write head is located at the left hand symbol of the string and is indicated with
an upward arrow.
Trace the computation of the Turing machine, using the transition function .
Show the contents of the tape, the current position of the read/write head and the
current state as the input symbols are processed.
The initial configuration of the machine has been completed for you in step 1.
[5 marks]
1.
...
SB
7.
...
State
2.
State
8.
...
...
State
3.
State
9.
...
...
State
4.
State
10.
...
...
State
5.
11.
...
State
6.
State
...
State
...
State
Turn over
(29)
M/Jun14/COMP3
30
9 (b)
Do not write
outside the
box
The three rules shown below are part of the machines transition function.
Explain what effect these three rules, taken together, have on the tape, the read/write
head and the state of the Turing machine:
(S0, 0) =
(S0, 1) =
(S0, ) =
(S0, 0, )
(S0, 1, )
(SC0, ,)
[2 marks]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
9 (c)
A Universal Turing machine (UTM) is a special type of Turing machine that can be
considered to act like an interpreter.
Explain how a UTM can be considered to be an interpreter.
[2 marks]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
____
9
(30)
M/Jun14/COMP3
Do not write
outside the
box
31
10
A company operates a Local Area Network (LAN) which is used by its employees.
Figure 7 shows the topology of the LAN.
Figure 7
Segment
192.168.0
File
server
Router 1
Segment 192.168.1
File
server
A
Router 2
Gateway
C
Segment 192.168.2
Internet
Web server
10 (a)
10 (a) (i)
10 (a) (iii) the network adapter card in the computer labelled C ........................................................
[1 mark]
Turn over
(31)
M/Jun14/COMP3
32
10 (b)
Do not write
outside the
box
10 (c)
10 (c) (i)
(32)
M/Jun14/COMP3
Do not write
outside the
box
33
10 (c) (ii) Explain one disadvantage of using software as a service instead of using software
installed locally on individual computers.
[1 mark]
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
10 (d)
One difference between a Local Area Network (LAN) and a Wide Area Network (WAN)
is the area that they cover. Describe two other differences between a LAN and a
WAN.
[2 marks]
Difference 1 ........................................................................................................................
............................................................................................................................................
Difference 2 ........................................................................................................................
............................................................................................................................................
____
10
END OF QUESTIONS
(33)
M/Jun14/COMP3
34
Do not write
outside the
box
(34)
M/Jun14/COMP3
Do not write
outside the
box
35
There are no questions printed on this page
(35)
M/Jun14/COMP3
36
Do not write
outside the
box
(36)
M/Jun14/COMP3