Вы находитесь на странице: 1из 18

Now test yourself answers

Chapter 1
1 An algorithm is a sequence of instructions;
independent of any programming language;
to solve a problem; in a reasonable amount
of time. (max 3 marks)
2 An algorithm is independent of any
programming language; and does not have
to follow strict syntactical guidelines; an
algorithm must be clear and unambiguous to
a human reader while a program only needs
to be clear and unambiguous to the computer
running the code. (max 3 marks)
3 It is important to ensure code is easily
understood by yourself or other coders; if it
needs to be maintained or developed further in
the future. (max 2 marks)
4 Any four from below, 1 mark for data type and
description. (max 4 marks)
Boolean can only have two states
represented by true or false
String one or more alpha-numeric
characters joined together
Integer a whole number
Real or Float a number consisting of a
decimal point
Char or Character a single alpha-numeric
character
Array or List a collection of similar data
items collected under a single identifier
5 A variable is a named piece of memory that can
have its contents changed during execution time;
while a constant is a named piece of memory that
cannot have its content changed. (max 2 marks,
1 mark for variable and 1 mark for constant)

Chapter 2
1 Definite iteration has a finite number of loops to
execute; indefinite iteration will repeat until or while
a condition or criteria is met this could be zero, one,
a hundred, or an infinite number of times. (max 2
marks, 1 mark for definite and 1 mark for indefinite)
2 Maximum of 4 marks, 1 for each construct and
description. (max 4 marks)
Sequencing is the concept of instructions following
one another in a logical and sequential order.
Assignment is the concept of allocating a value
either a piece of data entered by the user, the
coder, or the results of some function to a
variable or constant for future reference.

Selection is the concept of choosing one path


through the program over another dependent
on the Boolean result of some test.
Repetition or iteration is the concept of
repeating a process or block of code either a
definite or indefinite number of times.
3 Any sensible answer that is deemed mark worthy.
1 mark for identifying a suitable syntax error and
1 mark for describing how it was solved. (max 2
marks)

Chapter 3
1 A relational operator is used for comparison;
for example is x < y compares two variables; A
Boolean operator is used for combining or altering
the results of a Boolean test; for example x < 10
AND x > 5 would combine the results of two tests
and ensure they are both TRUE. (max 4 marks, 1 for
each description and 1 for each example or expansion)
2 By using integer division, you can find the remainder
or modulus of a number divided by 2; If the remainder
is 0, then the number was even. If the remainder is
1, then the number was odd. (max 2 marks, one for
situation and one for expansion/clarification/example. Any
suitable example of a situation is acceptable)

Chapter 4
1 A subroutine is a section of code identified by
name. (max 2 marks, 1 for each underlined section)
2 A local variable is accessible or has scope only within
the subroutine in which it was created; a global
variable is accessible or has scope across the whole
program. (max 2 marks, 1 for each type of variable)
3 Using global variables can lead to unexpected
results caused by them being created in one section
of code and amended elsewhere, sometimes
by other members of the team. Global variables
can also be very wasteful of memory leading to
inefficient code as they may be needed only for a brief
time but the memory is allocated for the life of the
program. (max 4 marks, 1 for points, 1 for expansions
or explanations. Inverse explanations (from the point
of view of local variables) are acceptable but the same
point from both points of view counts only once.)
4 When a problem is decomposed, it is split in to
small chunks that can be easily managed. These
small chunks can then be tackled with each one
forming a subroutine. (max 2 marks, 1 for each
underlined section)

AQA A-level Computer Science

1 Hierarchy chart
(Any 7 of second row = 1 mark, all 13 of second row = 2 marks; each subordinate with correct parent = 1 mark
each)

ApplyShiftToASCIICode
ForCharacter

GetTextFromFile

GetTypeOfCharacter

2 Flowchart
(max 5 marks: 1 mark for Start and End; 1 mark
for first and third process boxes; 1 mark for third
process box and first decision leading to correct
place; 1 mark for count1 count1 + 1 box. 1 mark
for second decision leading to correct place.)

EncryptUsingRailFence

CipherText
Count1 0

Count2 Count1

CipherText CipherText + OriginalText[Count2]


Count2 Count2 + SizeOfRailFence

Count2 < LEN(OriginalText)?

N
Count1 Count1 + 1

Count1 = SizeOfRailFence?

Y
Return ciphertext

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

EveryNthCharacterSte
ganography

GetValueForN

GetPositionsToUse

DecryptUsingRailFence

UseCeasarCipher

EncryptUsingRailFence

GetSizeOfRailFence

GetKeyForCeasarCipher

DisplayCipherText

DisplayPlainText

GetTextFromUser

GetMenuChoice

Program

DisplayMenu

Now test yourself answers

Chapter 5

Now test yourself answers

3 Pseudo-code
(max 5, 1 mark for each box)
PROCEDURE EncryptUsingRailFence (OriginalText, SizeOfRailFence)
Ciphertext
FOR Count1 0 TO SizeOfRailFence
Count2 Count1
WHILE Count2 < LEN(OriginalText)
CipherText CipherText + OriginalText[Count2]
Count2 Count2 + SizeOfRailFence
END WHILE
END FOR
RETURN Ciphertext
END PROCEDURE

4 a) Trace table
(max 4 marks, 1 for column x correct, 1 for rows
1-3 of max correct, 1 for rows 4-7 of max correct,
1 for output column correct)
x

max

OUTPUT

0
3

5 a) Inheritance diagram
(max 4 marks, 1 for each row connected to the
right parent, and 1 for the arrows pointing in the
right direction)
Appliance

b) The algorithm finds and returns the largest


number in a list.
Printer

Chapter 6
1 Object orientation is a programming paradigm in
which the programmer defines objects which can
have both properties and methods or operations
which they can carry out. (1)
2 A class is a piece of code used to define behaviour
whereas an object is an instance of a class. (max 2
marks, 1 for each underlined section)
3 Inheritance allows a class to use the properties
and methods of a parent class. Polymorphism
allows one interface to have multiple
implementations depending on which object it is
acting upon. Overriding allows an existing method
from a parent class to be redefined with new
functionality in a child class. (max 3 marks, one
for each underlined section)
4 In composition aggregation, one object is composed
of two or more existing objects and is entirely
dependent upon them. Association aggregation is
where one object is made up of one or more existing
objects but is not entirely dependent upon them
for its own existence. (max 2 marks, 1 for each
underlined section)

Inkjet

Laserjet

Tablet

Inkjetmultifunction

Computer

Laserjetmultifunction

b) printer = class (applicance)


private
Manufacturer: String
BlackCartridgeCode: String
PurchaseDate: Date
(max 4 marks, 1 for printer = class(appliance)
or other sensible way of showing inheritance,
1 for private, 1 for manufacturer and
blackcartridgecode as strings, 1 for
purchasedate as date or other sensible data type)
c) inkjet-multifunction = class (printer)
private
isWifi: Boolean
(max 2 marks, 1 for inkjet-multifunction =
class (printer) or other sensible way of showing
inheritance, 1 for having isWifi and a Boolean
data type or other sensible data type)

AQA A-level Computer Science

Now test yourself answers

Chapter 7
1 Static data structures usually store a set
amount of data which is usually defined by the
programmer. A dynamic data structure can
use more or less memory as required through
the use of a heap. (max 4 marks, 1 for each
underlined section)
2 Flowchart
(max 5 marks, 1 mark for each area in a dashed
section)
Start

X0

Y0

Array[Y][X]
RANDOM NUM

iii) IF QSize = 0 THEN



REPORT ERROR
ELSE

OUTPUT RevisionCarts[FrontPointer]

QSize QSize 1

FrontPtr FrontPtr + 1

IF FrontPtr > 40 THEN


FrontPtr = 1

END IF
END IF
(max 6 marks, 1 for checking if queue is
empty; 1 for error if queue is empty; 1 for
the rest of the algorithm occurring only if the
queue is not empty; 1 for outputting the card
at the correct position; 1 for incrementing the
FrontPtr AND decrementing the QSize; 1 for
statement testing if the end of the queue has
been reached; 1 for setting the FrontPtr back
to 1 if this is the case)
2 a) LIFO means Last In, First Out. (1 mark for this
definition)
b) i)

X=

XX+1

Y
Y=

YY+1
X0

Y
stop

3 A text file would be a suitable file to use when


storing a list of names because the data is easily
organised and can be read by a human. An image
file would need to be stored as a binary file as
it contains non-human-readable data. (max 4
marks, 1 mark for each underlined example and
explanation; any reasonable example is acceptable)

Chapter 8
1 a) The cards are in a linear format and can only
be accessed from one end. This matches
the way a queue works. (max 1 mark for
underlined section)
b) i) FrontPtr = 8, RearPtr = 40, QSize = 33
(max 1 mark for all three)
ii) FrontPtr = 8, RearPtr = 3, QSize = 36
(max 1 mark for all three)

iii)

27

27

ii)

iv)

27

27

(1 mark for each correct diagram)


c) A stack is used when storing the results of
a recursive algorithm. (max 1 mark, any
relevant answer is acceptable)
3 A linear queue is accessible only from the front,
and can be added to only from the rear end; a
circular queue is also accessible only from the
front and can be added to only from the end, but
the pointers to front and end can wrap around
to be able to re-use memory space; in a priority
queue each item is given a priority and when an
item is removed from the queue it is the foremost
item of the highest priority, so some items may be
skipped. (max 3 marks, 1 for each answer)

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

Chapter 10

1 a) (max 3 marks; 1 mark for lines leading from/to


number 1 and 2, 1 mark for lines leading from/
to number 3 and 4, 1 mark for lines leading from
to number 5; 1 mark for any incorrect lines)

1 a) Organising by hash rather than alphabetical


order allows for faster storage and retrieval
of data. (max 2 marks, 1 for each underlined
section)
b) A collision is the term used when the hashing
algorithm creates the same hash for two or
more different data items. (max 1 mark)
c) When a collision occurs in storage, one piece
of data may not be stored or may overwrite the
other; one solution to this would be to probe
for the next empty slot available and insert the
data there. (max 2 marks, one for the effect
and one for the solution; any relevant solution is
acceptable)
2 An array is indexed by number; while a dictionary is
indexed by a string or character sequence known as
a key. (max 2 marks, one for each section)

b) Unweighted (1 mark)
c) An adjacency matrix is most useful when
there are a large number of connections;
an adjacency list would be more useful
when there are a relatively small number of
connections. (max 2, 1 mark for each answer)
d) For the graph to be a tree it would need to be
undirected and have no cycles. (max 2, 1 for
each underlined section)
2 (max 3 marks, 1 mark for Bon Jovi and Iron Maiden
with correct parents, 1 mark for AC/DC, Green
Day and Metallica with correct parents, 1 mark for
Rolling Stones and Pink Floyd with correct parents)

Chapter 11
1 Vector addition has the effect of translating/
displacing the vector while scalar-vector
multiplication scales/enlarges or shrinks the
vector without altering its direction. (1 mark
each for each underlined section; max 2)
a) (max 1 mark for both correct arrows)
5
4
A

Foo Fighters

2
1
0

Bon Jovi

Now test yourself answers

Chapter 9

Iron Maiden

b) (max 1 mark for correct drawing)

AC/DC
Green Day

Metallica

4
A

Rolling Stones

A+B

Pink Floyd

c)



A.B = A xBx+AyBy

= 2 2 + 3 1 [1]

=4+3

= 7 [1]
(max 2 marks where indicated; if final answer is
correct and any working is shown then full marks
should be awarded)

AQA A-level Computer Science

Now test yourself answers

Chapter 12
1 F, C, D, M, G, P (max 3, 1 for each pair in the
correct order)
2 F, C, M, D, G, P (max 3, 1 for each pair in the
correct order)

Chapter 13
1 The purpose of Dijkstras shortest path algorithm
is to find the shortest path between two nodes
on a graph datatype. (max 1 mark for underlined
section)
2 Dijkstras shortest path algorithm requires a
weighted graph with positive weights only on the
edges. (max 2, 1 mark for each underlined section)
3 (max 5 marks, 1 for each correct row)

Step

Vertex

Carlisle

Newcastle

Middlesbrough

Leeds

Scarborough

Carlisle

0C

59C

126C

Newcastle

0C

59C

100N

126C

Middlesbrough

0C

59C

100N

126C

149M

Leeds

0C

59C

100N

126C

149M

Scarborough

0C

59C

100N

126C

149M

Chapter 14

Chapter 15

1 A linear search starts at the beginning of a data


set and tests each element in turn until it finds
the one it is looking for. It may be faster than
a binary search when data is unordered and
would be suitable for searching for a word in a
sentence. (max 3, 1 for each underlined section;
any suitable example is acceptable)
2 A binary search repeatedly checks the middle
element and discards half of the data set until it
finds the element it is looking for. It may be faster
than a linear search when data is ordered and
would be suitable for searching through a school
register for a particular student. (max 3, 1 for
each underlined section; any suitable example is
acceptable)
3 a) 873 (max 1 for correct answer)
b) 10 (max 1 for correct answer)

1 a) 3 /4 (max 1 for correct answer)


b) 7 + 2 (max 1 for correct answer)
c) 3 * (5 + 2) (max 2, 1 for 3 *, 1 for 5 + 2 in
brackets)
d) (3 + 4) * 9 (max 2, 1 for 3 + 4 in brackets, 1 for * 9)
2 a) 4 2 + (max 1 for correct answer)
b) 9 4 / (max 1 for correct answer)
c) 4 3 + 2 * (max 2, 1 for 4 3 +, 1 for 2 *)
d) 7 5 + 2 1 + / (max 2, 1 for 75 +, 1 for 2 1 + /)
3 (max 3, 1 for stack 1 and 2, 1 for stack 3 and 4, 1 for
stack 5, 6 and 7)
4

2
4

((4 + 2)/1)*2

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

1
6

2
6

12

Chapter 17

1 FUNCTION bubbleSort(alist)
FOR passnum LEN(alist) TO 0 STEP -1
//Backwards FOR loop

FOR i 0 TO passnum

IF alist[i] > alist[i+1]
THEN SWAP alist[i], alist[i+1]

END FOR
END FOR
RETURN alist
END FUNCTION
(max 3, 1 for outer loop with valid looping criteria,
1 for inner loop with valid looping criteria, 1 for
valid IF statement and swapping items; comparative
flowchart or other working pseudo-code also
acceptable)
2 a) [4, 2, 6, 3, 8, 1, 7, 9]
[2, 4, 3, 6, 1, 7, 8, 9]
[2, 3, 4, 1, 6, 7, 8, 9]
[2, 3, 1, 4, 6, 7, 8, 9]
[2, 1, 3, 4, 6, 7, 8, 9]
[1, 2, 3, 4, 6, 7, 8, 9]
(max 3 marks, 1 for 2 rows correct, 2 for 4 rows
correct, 3 for all 6 rows correct)
b) (max 4 marks, 1 for rows 14, 1 for rows 58,
1 for rows 911, 1 for rows 1214; any other
format is acceptable as long as it is clear what is
happening)

1 Abstraction is the concept of removing unneeded


complexity from a problem leaving just the detail
needed to solve the problem. (max 2 marks, 1 for
each underlined section)
2 Automation is the process of creating computer
models of real life situations and putting them in to
action. (max 2 marks, 1 for each underlined section)
3 Decomposition is the process of splitting a
problem in to small manageable tasks. (max 2
marks, 1 for each underlined section)
4 (max 4, 1 for inputting height and base (could be
in same segment), 1 for calculating area, 1 for
multiplication, 1 for dividing by 2; parent/child
relationship must be maintained for marks)

Now test yourself answers

Chapter 16

Calculate area
of triangle

Input height

Input base

Calculate area

Multiply height
by base

Divide result
by 2

Chapter 18
1 a) The accepting state of a Finite State Machine is
the state the system must end in for the input
to have been valid. (max 1 mark for underlined
section)
b) (max 3 marks, 1 for each input and
corresponding new state)

Split

[4, 6, 2, 9, 3, 8, 1, 7] [4, 6,
2, 9] and [3, 8, 1, 7]

Split

[4, 6, 2, 9] [4, 6] and [2, 9]

Split

[4, 6] [4] and [6]

Merge

[4, 6]

Split

[2, 9] [2] and [9]

Input

New State

Merge

[2, 9]

10

S10

Merge

[2, 4, 6, 9]

20

S20

Split

[3, 8, 1, 7] [3, 8] and [1, 7]

50

S50

Split

[3, 8] [3] and [8]

10

Merge

[3, 8]

11

Split

[1, 7] [1] and [7]

12

Merge

[1, 7]

13

Merge

[1, 3, 7, 8]

14

Merge

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

c)


10,20,20
50
20,20,10
(max 3, 1 for each correct input pattern; any valid
pattern is acceptable)
d) See table on next page.
(max 4, 1 for correct rows 1 and 2, 1 for correct
rows 3 and 4, 1 for correct rows 5,6 and 7, 1 for
correct rows 8, 9 and 10; note that rows do not
need to be in this order)

AQA A-level Computer Science

Now test yourself answers

Input

Current State

New State

10

S0

S10

20

S0

S20

50

S0

S30

10

S10

S20

20

S10

S30

10

S20

S30

20

S20

S40

10

S30

S40

20

S30

S50

10

S40

S50

Chapter 20

Chapter 19
1 A Turing machine is developed to solve a specific
problem whilst a Universal Turing machine can
simulate any other Turing machine. (max 2, 1
mark for each underlined section)
2 Turing machines produce a model of what is, and
is not computable. (max 1 mark for underlined
section)
3 a) (max 4, 1 for rows 1 and 2, 1 for rows 3 and 4,
1 for rows 5 and 6, 1 for row 7)
1 1 0 1 0

Current State:

S1

1 1 0 1 0

Current State:

S1

1 1 0 1 0

Current State:

S1

1 1 0 1 0

Current State:

S1

1 1 0 1 0

Current State:

S1

1 1 0 1 0

Current State:

S1

1 1 0 1 0 0

Current State:

S2

b) Multiplies the binary number by 2 (max 1 mark


for correct answer; note that adds a 0 on to the
end is not enough)

1 a) Zero or more a followed by one b, e.g. b, ab,


aab, aaab, ad infinitum. (max 1 mark for
description and/or examples)
b) One or more c followed by one d, e.g. cd, ccd,
cccd, ad infinitum. (max 1 mark for description
and/or examples)
c) Zero or one e followed by one f, e.g. e, ef. (max
1 mark for description and/or examples)
2 a(bc)?e* (max 2, 1 for a(bc)? and 1 for e*)
3 <digit> ::= 0|1|2|3|4|5|6|7|8|9
<integer> ::= <digit>|<digit><integer>
<real> ::= <integer> . <integer>
<symbol> ::= + |/||*
<sum> ::= <real> <symbol> <real>
(max 4, 1 for defining a digit, 1 for defining an integer
and a real number (or any other relevant way of
defining a real number), 1 for defining symbol and 1
for defining sum; note that names should be relevant
but do not need to match)

Chapter 21
1 a) A B = {A, E, I, O, U, H, L} (max 1 mark for
correct answer)
b) Cartesian Product = {(A,H), (A,E), (A,L), (A,O),
(E,H), (E,E), (E,L), (E,O), (I,H), (I,E), (I,L), (I,O),
(O,H), (O,E), (O,L), (O,O), (U,H), (U,E), (U, L),
(U, O)} (max 1 mark for correct answer)
c) A B = {E, O} (max 1 mark for correct answer)
d) A B = {A, I, U, H, L} (max 1 mark for correct
answer)
2 When a set has cardinality, it can be set to be
countable using natural numbers. Its cardinality
is the number of elements in the set. (max 1
mark for underlined section)
3 A = {x | x x 4} (max 2 marks, 1 for first half
up to ^, 1 for second half after ^; ^ must be included
for both marks)

Chapter 22
1 An unsolvable problem is something that cannot
be calculated at all. An intractable problem can
be calculated, but not in a useful amount of time.
(max 2 marks, 1 for each underlined section)
2 The halting problem is important because it
shows us that there are some problems that
cannot be solved. (max 1 mark for underlined
section)
3 When faced with an intractable problem, a
programmer will often use a heuristic approach,
accepting a sub-optimal solution. (max 2 marks,
1 for each underlined section)

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

Most efficient

(max 2 marks, 1 for correct conversion of 45 to


binary, 1 for correct final number 00110001)

O(N)

O(N log N)

O(N )

Least efficient

O(2 )
N

Chapter 23
1 a) (max 1 mark for correct answer)
b) (max 1 mark for correct answer)
c) (max 1 mark for correct answer)
2 a) (max 1 mark for any correct answer)
b)
2 (max 1 mark for any correct answer)
c) 1 (max 1 mark for any correct answer)
3 Ordinal numbers are numbers used to identify the
position of something relative to other numbers,
in the case of ASCII each symbol is designated a
number within the set. (max 2 marks, 1 for each
underlined section)
4 When a set is well-ordered, the contents are
related and in a defined order. (max 1 mark for
underlined section)

Chapter 24
1
2
3
4
5
6

Gi (max 1 mark for correct answer)


01110000 (max 1 mark for correct answer)
218 (max 1 mark for correct answer)
244 (max 1 mark for correct answer)
77 (max 1 mark for correct answer)
A programmer may use hexadecimal to save
space on screen when viewing code or data,
and to aid in recognition of commands. (max 2
marks, 1 for each underlined section)

Chapter 25
1 a) 11001100 // 204 (max 1 mark for correct
answer, either binary or decimal answer is
acceptable)
b) 11101100 // 236 (max 1 mark for correct
answer, either binary or decimal answer is
acceptable)
2 a) 00101101 (max 1 mark for correct answer)
b) 10110101 (max 1 mark for correct answer)
c) 10001011 (max 1 mark for correct answer)
3 94 into binary = 01011110. Convert 45 to 45, in
binary = 11010011

4 a) 00100.110 (max 2 marks, 1 for correct whole


number, 1 for correct fraction)
b) 10011.010 (max 2 marks, 1 for correct whole
number, 1 for correct fraction)
c) 00110.011 (max 2 marks, 1 for correct whole
number, 1 for correct fraction)
5 a) 27.625 (max 2 marks, 1 for correct whole
number, 1 for correct fraction)
b) 22.125 (max 2 marks, 1 for correct whole
number, 1 for correct fraction)
c) 14.9375 (max 2 marks, 1 for correct whole
number, 1 for correct fraction)
6 a) Exponent = 3, so DP needs bouncing 3 places
to the right, leaving: 1001.1100 2s complement
= 6.25 (max 2 marks, 1 for working, 1 for
correct final value)
b) Exponent = 1, so DP needs bouncing 1 place
to the left, leaving 0.01100000 2s complement
= 0.375 (max 2 marks, 1 for working, 1 for
correct final value)
7 117 in 2s complement binary is 10001011.0 [1].
The mantissa should be 1.0001011 [1]. To make
that happen the binary point needs to bounce
7 points to the left. Because we are doing this
in reverse, going left is a positive number so we
need our mantissa to be 7, 0111 [1]. (max 3 marks
as indicated)
8 a) To represent 7 we need to use 4 bits, so the
mantissa needs to be 0111 [1]. This leaves 4
bits for the exponent, 0.5, 0.25, 0.125, 0.0635.
Using these numbers the closest we can get to
0.9 is 0.875 (.1110) for the exponent [1] giving us
0111.1110 for our binary number. The DP would
need to bounce 3 points to the left, so our
mantissa would be 0.1111110 and the exponent
would be 0011 [1]. (max 3 marks as indicated)
b) The absolute error is 7.9 7.875 = 0.025. (max
1 mark for correct final value)
c) The relative error is 0.025 / 7.9 =
0.00316455696, or 0.0032 to 2 s.f.
(max 1 mark for correct final value)

AQA A-level Computer Science

Now test yourself answers

4 (max 2 marks, 1 for most and least efficient in


correct places, 1 for middle two in correct places)

Now test yourself answers


10

Chapter 26
1 ASCII uses 7 or 8 bits per character and
represents only Latin characters and extended
symbols. Unicode uses 16 bits per character and
can represent any character and language. (max
2 marks, 1 each for underlined sections or converse
statements)
2 Unicode contains ASCII as a subset so every
ASCII character can also be stored in Unicode.
ASCII characters have the same character codes
as they do in Unicode. (max 2 marks, 1 each for
underlined sections)
3 Parity checks are quick and relatively cheap
in terms of data transmission, but only detect
single errors and cannot repair data; check digits
require a lot of processing but detect any number
of errors, they cannot repair data; majority
vote can catch a lot of errors and requires little
processing; it can repair errors but takes three
times the amount of data for transmission. (max
3 marks, 1 for each section)
4 Resolution is w h = 1000 600 = 600000 pixels;
storage space = resolution bit depth = 600000
12-bits = 7200000 bits = 900000 bytes = 900
kilobytes. (max 2 marks, 1 for resolution and 1 for size)
5 Line colour, fill colour, line thickness. (max
3 marks for any three sensible answers)
6 Bitmap images can show very fine detail but can
take up large amounts of space. When zoomed in
they lose quality (pixelate). Vector images are better
for geometrical images rather than photographic
images but images intended to cover very large
sizes can have very small file sizes and do not lose
quality when enlarged. (max 4, 1 each for any of the
underlined sections)

7 a) 44000Hz * 16 bits = 704000 bits per sample


(88000 bytes per sample). 88000 * 150 seconds
= 13200000 bytes = 13.2 megabytes for the
song. (max 2 marks, 1 for sample size,
1 for song size)
b) If the song was stereo, it would have
two channels and the file size would be
doubled. (max 1 mark for underlined section)
c) 22000Hz (max 1 mark for correct answer)
8 Lossy compression can often produce significantly
smaller files, but some information which the
algorithm deems less important is lost; lossless
compression can reproduce the original file in its
entirety but may not save as much space. (max 2
marks, 1 each for the underlined sections)
9 a) Run length encoding traverses the file looking
for repeated patterns. When it identifies them, it
replaces the pattern with one copy of the pattern,
and the number of times it is repeated. (max 3
marks, 1 each for the underlined sections)
b) Dictionary-based encoding traverses the file
looking for looking for regularly used patterns.
When it finds them, it puts them in a dictionary
and assigns them a token which is inserted
in the file in the place of the pattern. (max 3
marks, 1 each for the underlined sections)
10 a) Lossy (max 1 mark for correct answer)
b) Lossless (max 1 mark for correct answer)
c) Lossless (max 1 mark for correct answer)

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

Now test yourself answers

Chapter 27
1 A cipher deemed computational secure is
theoretically breakable, but not using current
technology. (max 2, 1 each for underlined
sections)
2 The Caesar cipher is relatively easy to crack and
uses substitution to produce the cipher text. The
Vernam cipher is computationally impossible
to crack and uses one-time pads of random
characters to produce the cipher text. (max 4
marks, 1 each for underlined sections)
3 Frpsxwhu Vflhqfh lv juhdw (max 1 mark for
correct answer)
A

B C

D E

D E
G

H I

H I

M N O

M N O
P

Chapter 28
1 An interpreter goes through source code one line
at a time and executes it accordingly; a compiler
will convert the whole source document in to
object code in one go; an assembler translates
assembly code straight in to object code in a
1-to-1 relationship. (max 3 marks, 1 for each
translation tool)
2 Keyboard, mouse, monitor (max 3 marks for any
3 suitable points)
3 An operating system acts as a virtual machine
between the user and the hardware. The
operating system is required to manage processor
allocation, ensuring tasks have access to the
CPU cores as and when needed. It handles
peripheral management, enabling differing
peripheral devices to be controlled by software
as required. It also handles the allocation of
memory to processes from the heap as needed
to ensure each process has enough memory to
perform its actions without conflicting with other
processes. (max 7 marks, 1 for defining a virtual
machine, 1 each for relevant points and explanations/
examples; any suitable responsibilities acceptable)

Chapter 29
1 a) Writing a desktop application as there are
many pre-written routines available to
imperative languages to save development
time. (max 2 marks, 1 each for example
and justification; any suitable example and
justification acceptable)
b) Performing mathematical calculations
because functional languages lend themselves

R S

U V

R S

U V

W X

W X

B C

in terms of their syntax to easily understood


calculations and formulae. (max 2 marks, 1
each for example and justification; any suitable
example and justification acceptable)
c) Querying a database because you want to be
able to tell the database what information
you want and let the database management
system decide how best to do that on the
underlying architecture in place. (max 2
marks, 1 each for example and justification; any
suitable example and justification acceptable)
d) Gaming graphics coding as the processorintensive routines mean speed and efficiency
need to be as optimal as possible. (max 2
marks, 1 each for example and justification; any
suitable example and justification acceptable)
e) When writing code for a custom chip such as
an embedded ECU in a car, since there may not
be an HLL or assembler available for relatively
small production run systems. (max 2 marks,
1 each for example and justification; any suitable
example and justification acceptable)
2 An interpreter reads one line at a time and
executes it directly, repeating this process as
regularly as needed. A compiler translates
the entire file in one go prior to allowing it to
be executed, meaning each line of code only
needs translating once. (max 4 marks, 1 for
each underlined section or any other sensible
comparison)
3 A developer may want to use a bytecode based
language such as Java when they are developing
for multiple systems but do not want to have to
recompile for each one, and where speed is too
important to rely on an interpreted language. (max
2 marks, 1 for each underlined section)

AQA A-level Computer Science

11

Now test yourself answers

Chapter 30
1 a) (max 1 mark for correct table)

2 De Morgans laws state that NOT (A AND B) is the


same as NOT (A) OR NOT (B), and conversely that
NOT (A OR B) is the same as NOT (A) AND NOT
(B). This allows logical circuits to be simplified,
saving cost in production. (max 3 marks, 1 each for
underlined sections)
3 a)

A .B + A + B (DML)
[1]

A + B + (A .B )

B + (A .B ) = B (Absorbtion law) [1]


A + B [1]
(max 3 marks as indicated)

b) (max 1 mark for correct table)


A

c) (max 1 mark for correct table)


A

b) C + C = C [1]
C + D
[1]
(max 2 marks as indicated)
4 a) Answer: 1 (max 3, 1 mark for 4th and 6th columns,
1 mark for 7th column, 1 mark for correct answer)
A

d) (max 1 mark for correct table)

A.B

(A.B
.B+A.B
.B)

C.D

C.D + C + D

b) Answer: C + D (max 3, 1 mark for 3rd and 4th


columns, 1 mark for 5th column, 1 mark for
identifying the final answer correctly)

e) (max 1 mark for correct table)


A

5 Answer: The two final columns are identical.


(max 3 marks, 1 for each table and 1 for concluding
comment)

f) (max 1 mark for correct table)

12

A.B

.B
A.B A.B

A.B

A.B

A.B

A+ B

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

2 a) (max 5 marks, 1 for each logic gate with correct


inputs/outputs/symbols)

1 a) (max 2 marks, 1 for AND with correct input/


outputs, 1 for XOR with correct input/outputs)

B
B

Q
A

b) (max 2 marks, 1 for AND with correct input/


outputs, 1 for XOR with correct input/outputs)

b) (max 3 marks, 1 for each logic gate with correct


inputs/outputs/symbols)

B
C

Now test yourself answers

Chapter 31

A
Q

A
B

3 (A .B) + (B.C) (max 6 marks; in equation: 1 for


A.B, 1 for (B.C) , 1 for + in between and overbar
over whole thing; in table, 1 each for 4th, 6th and 8th
columns)
A

A.B

B.C

(B. C) (A.B) + (B. C)

(A . B) + (B. C)

AQA A-level Computer Science

13

Now test yourself answers

Chapter 32
1 a) Increasing the clock speed allows more
calculations to happen each second.
(max 1 for underlined section)
b) Increasing the width of the address bus
allows more memory locations to be
accessible. (max 1 for underlined section)
2 A bus is a series of parallel wires used to
connect the internal components of the CPU.
(max 2 marks, 1 for each underlined section)
3 (b) (max 1 mark for correct answer)

Chapter 33
1 The Status Register keeps track of the status of
various parts of the computer such as whether
an overflow error has occurred. The Current
Instruction Register stores the instruction that is
currently being executed by the processor. The
Program Counter stores the memory location
of the next instruction that will be needed by
the processor. (max 6 marks, 3 1 for relevant
registers, 3 1 for appropriate descriptions)
2 Increasing the clock speed means the calculations
and movement of data will happen more frequently
meaning more calculations are performed per
second. (max 2 marks, 1 for each underlined section)
3 The contents of the program counter is
transferred to the memory address register;
Simultaneously the contents of the program
counter are incremented; and the contents of
the memory location address are loaded into the
memory buffer register; The contents of
the memory buffer register are copied into the
current instruction register; the instructions
is decoded; and finally the instruction is
executed. (max 6 marks, per section)

Chapter 34
1 Immediate addressing loads the data directly
from the operand, while direct addressing
tells the CPU to get the data from a memory
or register address. (max 2 marks, 1 for each
underlined section)
2 The opcode is an instruction to perform a task,
while the operand is the thing the opcode must
use to perform the task. (max 2 marks, 1 for each
underlined section)
3 (max 6 marks, 1 per 2 lines except final 3. Note that
labels do not have to match but should be sensible).
LDR R3, 1
LDR R4, 2
CMP R3, R4
BGT morethan
BLT lessthan

14

MOV R1, #3
HALT
morethan:
MOV R1, #1
HALT
lessthan:
MOV R1, #2
HALT

Chapter 35
1 The RFID tag is placed near a reader which emits
electromagnetic power; the power energises the
RFID chip; which transmits its ID code; the reader
detects this code and passes it to a computer to
be dealt with. (max 4 marks, 1 for each section)
2 A drum rotates inside the printer and is coated
in a chemical which holds an electrical charge;
the laser beam is directed onto the drum which
alters the charge in the chemical; the drum picks
up toner on the charged area and passes it to the
oppositely charged paper; the toner is then fused
to the paper using heat. (max 4 marks, 1 for each
section)
3 Light coming through the lens is focussed on to
a sensor; the sensor is made up of transistors
which record the light and correspond to pixels;
the data is stored onto flash memory; and can
be transferred to a computer for editing and
viewing. (max 4 marks, 1 for each section)
4 Hard drives have rotating platters which store
the data while SSDs have no moving parts. Hard
disk platters are covered in a film of magnetic
material which has its charge changed when data
is stored, while SSDs use NAND memory chips
made up of semiconductors. Because a hard disk
has to move its read/write head to the correct
location, there can be some lag before finding
the right location. SSDs do not suffer this lag as
there are no moving parts. (max 6 marks, 1 per
underlined section)

Chapter 36
1 Some might believe that because MP3s are easily
accessible, there is no problem with downloading
them; however, if you download them from an
unofficial website instead of buying them, the
artist does not receive any payment for the work
they have done. This could lead to them not
producing more music in the future. Original
works are covered by the Copyright, Designs
and Patents Act and it is illegal to duplicate
copyrighted material without permission. By
downloading a song, you are duplicating it
onto your hard drive, and so in breach of the
law. (max 6 marks as identified or other relevant
points/expansions)

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

3 CSMA/CA checks first whether the transmission


medium is idle; if it is, it sends the data, but if not
it will wait a random amount of time and then try
again; on receipt of the data an acknowledgement
is sent back to the sending device; if this is not
received, then the data is resent. (max 3 marks)
4 The SSID can be stopped from broadcasting itself;
strong encryption [WPA/WPA2] can be used; and
a white list of allowed MAC addresses can be
created. (max 3 marks)

Chapter 39

1 Bit rate describes the speed that a transmission


is taking place at; the baud rate is the number of
electronic state changes per second; although
unusual, it is possible to send multiple bits per state
change; bandwidth is the capacity of the channel
down which the data is being transmitted.
(max 4 marks, 1 for each section)
2 The cost of implementing parallel transmissions
can be prohibitive due to needing many times the
amount of transmission media and associated
hardware; additionally, ensuring that signals are
in sync across multiple transmission media can
be difficult to manage. (max 2 marks, 1 for each
section)
3 Protocols are accepted sets of rules agreed upon
and followed to allow different computers to
communicate with one another. (max 1 mark for
underlined section)

1 The Internet is a physical network of networks;


whilst the World Wide Web is a software service
available on the Internet. (max 2 marks, 1 for
each section)
2 https is the protocol;
www is the name of the host machine;
coolcomputing.com is the name of the domain;
/pages is the directory the files are located in on
the server;
index.html is the file name being accessed;
(max 3 marks, for any 3 of the above)
3 43.123.32.5 is the IP address of the machine being
accessed.
23 is the port number of the service being
accessed (max 2 marks, 1 for each point above)
4 IPv4 addresses work on every computer and
system available. However, there are very few if
any IPv4 addresses left available and as such they
are quite expensive to buy. IPv6 addresses are not
yet supported by every available system so there
may be some compatibility problems. However,
there are many addresses available so they
should be more cost-effective. (max 6 marks,
1 mark for each underlined point or other relevant
point/expansion)

Chapter 38

Chapter 40

1 A LAN covers a small geographical area,


normally one building or small site. A WAN
covers a large geographical area, often multiple
sites. (max 2 marks, 1 per section)
2 a) A peer-to-peer network might be used
at home because there is no need for the
level of security offered by a client-server
network. (max 2 marks, 1 for example and
1 for justification)
b) A client-server network might be used in
school where computers regularly break and
can be replaced without needing to worry
about rescuing files and software. (max 2
marks, 1 for example and 1 for justification)

1 Firewalls block ports and programs that try to


gain unauthorised access to the computer, while
proxy servers hide the internal network from the
Internet. (max 2 marks, 1 per underlined section)
2 Both computers have a public key [1] and a private
key [1] which are mathematically connected [1].
The sender uses the receivers public key to
encrypt the file [1].
The receiver uses their own private key to decrypt
the file [1]. (max 5 marks as indicated)
3 The certificate contains the name of the company,
its server details, and a serial number. This serial
number can be used to check the details with
the issuing authority to ensure they are who they

Chapter 37

AQA A-level Computer Science

Now test yourself answers

2 The law is a legal set of commands that one must


follow and can be enforced by the police. A code
of conduct is a guide of how things should be done
and is not legally enforceable. (max 4 marks, 1
per identified underlined section or other relevant
point/expansion)
3 Monitoring what a student is doing could be a
breach of their privacy, and could lead to the
college gathering personal information that
the student does not want to share. However,
students are expected to follow a code of conduct
within the college, and the college has to be
able to enforce this. As such the college needs
to make it clear in advance what it will monitor
and gather, and the student has to ensure they
do not break the regulations or they may end up
being disciplined according to the internal college
policies. (max 6 marks, 1 per identified underlined
section or other relevant point/expansion)

15

Now test yourself answers

say they are. (max 2 marks, 1 for each underlined


sections)
4 A Trojan hides within another file on your computer
and does not replicate itself so can remain
undetected for a long time. A virus attaches itself
to another file and replicates itself spreading both
internally and across a network. A worm does not
need to be attached to another file to spread around
and infect other machines. (max 6 marks, 1 per
underlined section)
5 a) A user can protect against malware by
installing and using up-to-date anti-virus
software. They can use a firewall to block
worms from spreading across the network
and most importantly need to be careful when
opening file attachments. (max 3 marks,
1 per underlined section or other reasonable
methodology)
b) A programmer must thoroughly test code for
exploitable errors, and should update code as
new security threats come to light. All data
stored within a program should use accepted
and recognised encryption techniques.
(max 3 marks, 1 per underlined section or
other reasonable methodology)

Chapter 41
1 The application layer on the client chooses the
correct protocol in this case HTTP or HTTPS
[1]. This layer interacts with the web browser
and passes data down to the transport layer [1].
The transport layer establishes an end-to-end
connection between the client and the server [1]
and identifies relevant port numbers [1]. It then
splits the data into numbered packets [1] and
deals with error control [1]. The network layer
adds source and destination IP addresses [1].
The link layer then adds source and destination
MAC addresses [1] and deals with putting the
data on to the physical transmission medium [1].
The server receives the data and the link layer
removes the MAC addresses [1]. Data is passed
up with the source IP address and port number
being remembered for returning the data. The
transport layer reassembles the data packets
in order [1] and passes the request up to the
application layer which deals with the request [1].
The response is passed back down the stack and
returned to the client in the same way, using the
client IP address and port [1].
(max 8 marks, 1 each for identified points above. for
12 marks must have mentioned at least one layer,
for 34 marks must have mentioned at least two
layers, for 56 must have mentioned at least three
layers and for 78 marks must have mentioned all

16

four layers; note this would be marked as a QWC


[Quality of written communication] question)
2 https uses a secure connection and encrypts
data, while http does not. (max 1 mark for correct
answer)
3 Protocols are accepted sets of rules agreed upon
and followed to allow different computers to
communicate with one another. (max 1 mark)
4 Six (one for the web page itself, three for the
images, one for the movie and one for the script;
the other web pages will not be requested until
clicked on) (max 1 mark)

Chapter 42
1 The client makes a request of the server. The
server responds to that request, and then
provides the requested service. (max 3 marks, 1
for each underlined section)
2 CRUD describes the main functions that can be
performed on a database: create data, retrieve
data, update data and delete data. (max 5 marks,
1 for each underlined section)
3 An API usually consists of standardised
subroutines that allow one program to interface
with another one. (max 2 marks, 1 for each
underlined section)
4 I would recommend a thick-client solution [1].
For only eight users, the cost of a number of
dedicated servers [1] might not make up for
the saving in cost of the clients [1]. Because the
company does a lot of analysis, performing this
on the servers may block the other users from
performing their own analysis [1] so it may be
more effective to do this on the local client PCs
[1]. Such a small company probably couldnt
afford a dedicated IT support team to support the
needs of a more complex network [1]. (max 6
marks for identified points, alternative views allowed
as long as justified)

Chapter 43
1 a) A database that is in third normal form
satisfies the requirements of second normal
form, and has had non-key attributes that
depend upon other non-key attributes
removed. (max 2 marks, 1 for each underlined
section)
b) Storing data in normal form ensures that
there is no redundant data (saving space) and
that data is not stored multiple times (leading
to inconsistency). (max 2 marks, 1 for each
underlined section)

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

CustomerOrderLine

Unit

CustomerOrder

Customer

Items (item, colour)


Prices (item, price)
Taxes (price, tax)
(max 3 marks, 1 per line with correct primary keys)

Chapter 44
1 a) SELECT Borrower.Forename, Borrower.
Surname
FROM Borrower, Bike, Loan
WHERE Borrower.MemberID = Loan.
MemberID AND Loan.BikeID = Bike.BikeID
AND Bike.Make = Heffmann
(max 5 marks, 1 for correct SELECT statement
(ignore additional fields), 1 for correct FROM
statement, 1 each for correct WHERE statements
connected by ANDs, 1 for each missing AND)
b) INSERT INTO Bike
VALUES (MG0013,MuddyGoat,Animal,2015)
(max 2 marks, 1 for correct table on insert line,
1 for correct data and format on values line)
c) Using record locks a lock is put on the data
item so no other user can save to that location
until the lock is removed. Serialisation will
only allow transactions to take place one at a
time. (max 4 marks, 1 for name of methodology
and 1 for expansion of each; other methodologies
allowed and should be marked accordingly)

Chapter 45
1 Big data is datasets that are either too large
or too complex to be handled using traditional
database techniques. (max 3 marks, 1 for each
underlined section)
2 a) The company may struggle to store such large
amounts of data. Due to the structure (or lack
of), the company may struggle to analyse the
data effectively. The company may well need
specialised software to manage and extract
meaningful information from the data. (Max
3 marks, 1 for each underlined section or other
relevant problems)

b) One methodology the company may employ is


to make use of a super-computer to perform
huge amounts of processing. They may choose
to use a large dedicated network to share the
load across multiple machines, and employ
distributed processing. They may use functional
programming to allow different processors to
work on different aspects of the data at the same
time. (max 3 marks, 1 for each underlined section
or other relevant solutions)

Chapter 46
1 A functional programming language is one
which has each line of code made up of calls to a
function which may be made up of other functions
or result in a value. (max 2 marks, 1 for each
underlined section)
2 A first class object is an object which can be
passed as an argument or returned by a function.
A higher order function can accept another
function as an argument. (max 2 marks, 1 for
each underlined section)

Now test yourself answers

c) (max 4 marks, 1 per relationship; max 2 if any


incorrect relationships drawn)

Chapter 47
1 [2,6,10,14] (max 1 mark for correct answer)
2 [32,32,31,212] (max 2 marks, 1 mark for including
correct answers, 1 mark for not including anything
incorrect)
3 24 (max 1 mark for correct answer)

Chapter 48
1 a) During analysis it is important to fully analyse
the problem, gather information and perform
a feasibility study to see if the system can
realistically be put in to place. (max 3 marks,
1 for each underlined section or other reasonable
points/expansions)
b) During the design stage, the algorithms, data
and interface are designed and checked with
the client. (max 3 marks, 1 for each underlined
section or other reasonable points/expansions)
c) During the implementation stage, the actual
code and data structures are created. This
may involve the production of prototypes for
checking. (max 3 marks, 1 for each underlined
section or other reasonable points/expansions)
d) During the testing stage, the system is tested
both as modules and as a full system with
normal, boundary and erroneous data. (max
3 marks, 1 for each underlined section or other
reasonable points/expansions)

AQA A-level Computer Science

17

Now test yourself answers

e) During the evaluation stage the system is


judged according to certain success criteria
that were developed in the specification to
ensure it is fit for purpose. (max 3 marks,
1 for each underlined section or other reasonable
points/expansions)
2 During black box testing you only see the input
and output, not what is happening inside the
subroutine(s). During white box testing, the tester
looks inside the subroutine(s) and checks all the
pathways through the code. Unit testing makes
sure each unit carries out the function it has been
designed for and incorporates both black box
and white box testing. (max 3 marks, 1 for each
underlined section)

3 Normal data is data that should be entered


into the program to produce a required result.
Boundary data is just on, above, or below the
limit of what is and is not acceptable for the
program. Erroneous data is data that should not
be entered into the program (it is wrong) but
could inadvertently be entered. (max 3 marks,
1for each underlined section)
4 A data flow diagram is a visual representation
of how data are moved around a system.
(max 2 marks, 1 for each underlined section)

18

Exam practice answers at www.therevisionbutton.co.uk/myrevisionnotes

Вам также может понравиться