Computer Science: AQA AS and A Level
Computer Science: AQA AS and A Level
Computer Science: AQA AS and A Level
Computer
Science
AQA AS and A Level
Computer Science
P.M. Heathcote
R.S.U. Heathcote
Published by
PG Online Limited
The Old Coach House
35 Main Road
Tolpuddle
Dorset
DT2 7EW
United Kingdom
[email protected]
www.pgonline.co.uk
2016
Acknowledgements
We are grateful to the AQA Examination Board for permission to use questions from past papers.
The answers in the Teacher’s Supplement are the sole responsibility of the authors and have neither
been provided nor approved by the examination board.
We would also like to thank the following for permission to reproduce copyright photographs:
Screenshots of Arriva Bus App © Arriva PLC
Colossus photograph © The National Archives
Google Maps ‘StreetView’ © Google 2015
Screenshot from Roboform website © Roboform
Alan Turing © By kind permission of the Provost and Fellows, King’s College, Cambridge
from Archives Centre, King’s College, Cambridge. AMT/K/7/12
Trans-continental Internet connections © Telegeography
Internet registries map © Ripe NCC
Other photographic images © Shutterstock
A catalogue entry for this book is available from the British Library
ISBN: 978-1-910523-07-0
Copyright © P.M.Heathcote and R.S.U.Heathcote 2016
All rights reserved
No part of this publication may be reproduced, stored in a retrieval system, or transmitted
in any form or by any means without the prior written permission of the copyright owner.
Printed and bound in Great Britain by Lightning Source Inc., Milton Keynes
ii
Preface
The aim of this textbook is to provide detailed coverage of the topics in the new AQA AS and A Level
Computer Science specification.
The book is divided into twelve sections and within each section, each chapter covers material that can
comfortably be taught in one or two lessons.
In the first year of this course there will be a strong emphasis on learning to program. You will start by
learning the syntax of your chosen programming language – that is, the rules of how to write correct
statements that the computer can understand. Then you will code simple programs, building up your
skills to the point where you can understand and make additions and amendments to a program
consisting of several hundred lines of code.
Sections 1 and 2 of this book can be studied in parallel with your practical programming sessions. It will
give you practice in the skills you need to master.
In the second year of this course the focus will turn to algorithms and data structures, covered in
Sections 7 and 8. These are followed by sections on regular languages, the Internet and databases.
Object Oriented Programming and functional programming are covered in the final section, which
describes basic theoretical concepts in OOP, as well as providing some practical exercises using the
functional programming language Haskell. Lists, the fact-based model and ‘Big Data’ are all described
and explained.
Two short appendices contain A Level content that could be taught in the first year of the course as an
extension to related AS topics.
The OOP concepts covered may also be helpful in the coursework element of the A Level course.
Each chapter contains exercises and questions, some new and some from past examination papers.
Answers to all these are available to teachers only in a Teacher’s Supplement which can be ordered from
our website www.pgonline.co.uk.
This textbook has been approved by AQA for use with our qualification. This means that we have
checked that it broadly covers the specification and we are satisfied with the overall quality. Full details of
our approval process can be found on our website.
We approve textbooks because we know how important it is for teachers and students to have the right
resources to support their teaching and learning. However, the publisher is ultimately responsible for the
editorial control and quality of this book.
Please note that when teaching the A Level Computer Science course, you must refer to AQA’s
specification as your definitive source of information. While this book has been written to match the
specification, it cannot provide complete coverage of every aspect of the course.
A wide range of other useful resources can be found on the relevant subject pages of our
website: www.aqa.org.uk.
iii
Contents
Section 1
Fundamentals of programming 1
Chapter 1 Programming basics2
Chapter 2 Selection8
Chapter 3 Iteration13
Chapter 4 Arrays17
Chapter 5 Subroutines21
Chapter 6 Files and exception handling 29
Section 2
Problem solving and theory of computation 33
Chapter 7 Solving logic problems 34
Chapter 8 Structured programming 39
Chapter 9 Writing and interpreting algorithms 42
Chapter 10 Testing and evaluation 48
Chapter 11 Abstraction and automation52
Chapter 12 Finite state machines60
Section 3
Data representation 67
Chapter 13 Number systems 68
Chapter 14 Bits, bytes and binary72
Chapter 15 Binary arithmetic and the representation of fractions77
Chapter 16 Bitmapped graphics83
Chapter 17 Digital representation of sound88
Chapter 18 Data compression and encryption algorithms93
iv
Section 4
Hardware and software 99
Chapter 19 Hardware and software100
Chapter 20 Role of an operating system103
Chapter 21 Programming language classification106
Chapter 22 Programming language translators110
Chapter 23 Logic gates114
Chapter 24 Boolean algebra118
Section 5
Computer organisation and architecture 125
Chapter 25 Internal computer hardware126
Chapter 26 The processor132
Chapter 27 The processor instruction set138
Chapter 28 Assembly language142
Chapter 29 Input-output devices148
Chapter 30 Secondary storage devices154
Section 6
Communication: technology and consequences 158
Chapter 31 Communication methods159
Chapter 32 Network topology 164
Chapter 33 Client-server and peer-to-peer168
Chapter 34 Wireless networking, CSMA and SSID171
Chapter 35 Communication and privacy176
Chapter 36 The challenges of the digital age179
v
Section 7
Data structures 187
Chapter 37 Queues 188
Chapter 38 Lists 194
Chapter 39 Stacks 198
Chapter 40 Hash tables and dictionaries 202
Chapter 41 Graphs 207
Chapter 42 Trees 211
Chapter 43 Vectors 217
Section 8
Algorithms 223
Chapter 44 Recursive algorithms 224
Chapter 45 Big-O notation 229
Chapter 46 Searching and sorting 235
Chapter 47 Graph-traversal algorithms 243
Chapter 48 Optimisation algorithms 249
Chapter 49 Limits of computation 254
Section 9
Regular languages 259
Chapter 50 Mealy machines 260
Chapter 51 Sets 265
Chapter 52 Regular expressions 269
Chapter 53 The Turing machine 273
Chapter 54 Backus-Naur Form 278
Chapter 55 Reverse Polish notation 283
vi
Section 10
The Internet 287
Chapter 56 Structure of the Internet 288
Chapter 57 Packet switching and routers 292
Chapter 58 Internet security 294
Chapter 59 TCP/IP, standard application layer protocols 300
Chapter 60 IP addresses 307
Chapter 61 Client server model 313
Section 11
Databases and software development 318
Chapter 62 Entity relationship modelling 319
Chapter 63 Relational databases and normalisation 323
Chapter 64 Introduction to SQL 330
Chapter 65 Defining and updating tables using SQL 336
Chapter 66 Systematic approach to problem solving 342
Section 12
OOP and functional programming 346
Chapter 67 Basic concepts of object-oriented programming 347
Chapter 68 Object-oriented design principles 353
Chapter 69 Functional programming 360
Chapter 70 Function application 367
Chapter 71 Lists in functional programming 371
Chapter 72 Big Data 374
References 379
Index 391
vii
CHAPTER 1 – PROGRAMMING BASICS
String-handling functions
Programming languages have a number of built-in string-handling methods or functions. Some of the
common ones in a typical language are:
len(string) Returns the length of a string
string.substring(index1,index2) Returns a portion of string inclusive of the characters at
each index position
string.find(str) Determines if str occurs in a string. Returns index (the
position of the first character in the string) if found, and -1
otherwise. In our pseudocode we will assume that string(1)
is the first element of the string, though in Python, for
example, the first element is string(0)
ord("a") Returns the integer value of a character (97 in this example)
chr(97) Returns the character represented by an integer
("a" in this example)
Converting between strings and dates is usually handled by functions built in to string library modules,
e.g. strtodate("01/01/2016").
Example:
date1 ß strtodate("18/01/2015")
date2 ß strtodate("30/12/2014")
days ß date1 - date2
OUTPUT date1, date2, days
5
SECTION 2 – PROBLEM SOLVING AND THEORY OF COMPUTATION
Example 1
Draw an FSM to model the states and transitions of a door. The door can be open, closed or locked.
It can change from the state of being open to closed, from closed to locked, but not, say, from locked
to open. (It has to be unlocked first.)
Transition condition
Transition
State
Close door Lock door
60
CHAPTER 12 – FINITE STATE MACHINES
Example 2
Draw an FSM to represent a light switch. When the button is pressed, the light goes on. When the button
is pressed again, the light goes off.
There is just one input B to this system: Button pressed (B=1) or Button not pressed (B=0).
B=1
B=0 B=0
Light Light
off on
B=1
Notice that in each state, both the transitions B=0 and B=1 are drawn. If the light is off, the transition
B=0 has no effect so the transition results in the same state. Likewise, if the light is on, as long as the
button is not pressed, the light will stay on.
Notation
Symbol Meaning
State
Start state
Accept state
Transition
61
SECTION 2 – PROBLEM SOLVING AND THEORY OF COMPUTATION
Example 3
Use an FSM to represent a valid identifier in a programming language. The rules for a valid identifier for
this particular language are:
• The identifier must start with a lowercase letter
• Any combination of letters and lowercase numbers may follow
• There is no limit on the length of the identifier
a-z
S1 S2 a-z, 0-9
0-9
S3 a-z, 0-9
In this diagram, the start state S1 is represented by a circle with an arrow leading into it.
The accept state S2 is denoted by a double circle.
2-12 S3 is a “dead state” because having arrived here, the string can never reach the accept state.
Each character of the input string is input sequentially to the FSM and if the last character reaches
the final state S2 (the accept state), the string is valid and is accepted. If it ends up anywhere else
the string is invalid.
Note that there can only be one starting state but there may be more than one accept state (or no
accept states).
Q1: Which of the following strings is valid and accepted by this finite state machine?
(i) a (ii) bba (iii) abbaa (iv) bbbb
S0 S1 a
b
b
S2
b
62
SECTION 3 – DATA REPRESENTATION
What is encryption?
Encryption is the transformation of data from one form to another to prevent an unauthorised third party
from being able to understand it. The original data or message is known as plaintext. The encrypted
data is known as ciphertext. The encryption method or algorithm is known as the cipher, and the
secret information to lock or unlock the message is known as a key.
The Caesar cipher and the Vernam cipher offer polar opposite examples of security. Where the Vernam
offers perfect security, the Caesar cipher is very easy to break with little or no computational power.
There are many others methods of encryption – some of which may take many computers, many years
to break, but these are still breakable and the principles behind them are similar.
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
â â â â â â â â â â â â â â â â â â â â â â â â â â
F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
Q2: Using the table above, what is the ciphertext for ‘JULIUS CAESAR’ using a shift of 5?
3-18 Q3: What word can be translated from the following ciphertext, which uses a key of -2: ZYBECP
You will no doubt be able to see the ease with which you might be able to decrypt a message using
this system.
96
CHAPTER 18 – DATA COMPRESSION AND ENCRYPTION ALGORITHMS
One-time pad
To provide perfect security, the encryption key or one-time pad must be equal to or longer in characters
than the plaintext, be truly random and be used only once. The sender and recipient must meet in person
to securely share the key and destroy it after encryption or decryption. Since the key is random, so will
be the distribution of the characters meaning that no amount of cryptanalysis will produce meaningful
results.
3-18
Q4: Using the ASCII chart and the XOR operator, what ciphertext character will be produced from
the letter E with the key w?
Using this method, the message “Meet on the bridge at 0300 hours” encrypted using a one-time pad
of +tkiGeMxGvnhoQ0xQDIIIVdT4sIJm9qf will produce the ciphertext:
The encryption process will often produce strange symbols or unprintable ASCII characters as in the
above example, but in practice it is not necessary to translate the encrypted code back into character
form, as it is transmitted in binary. To decrypt the message, the XOR operation is carried out on the
ciphertext using the same one-time pad, which restores it to plaintext.
Exercises
1. Explain the difference between lossy and lossless data compression. [2]
97
SECTION 5 – COMPUTER ORGANISATION AND ARCHITECTURE
0100 1100 LDA #12 Load the number 12 into the accumulator
0010 0010 ADD #2 Add the number 2 to the contents of the accumulator
0111 1111 STO 15 Store the result from the accumulator in location 15
The # symbol in this assembly language program signifies that the immediate addressing mode is being
used.
Q5: Write a statement in a high level language which performs an operation equivalent to the
three statements in the above machine code program, with the result being stored in a
location called TOTAL.
5-27 Q6: Write a machine code program, and an equivalent assembly language program, to add the
contents of locations 10 and 11 and store the result in location 14.
Exercises
1. A computer with a 16-bit word length uses an instruction set with 6 bits for the opcode, including
the addressing mode.
(a) What is an instruction set?[1]
(b) How many instructions could be included in the instruction set of this computer? [1]
(c) What is the largest number that can be used as data in the instruction? [1]
(d) What would be the effect of increasing the space allowed for the opcode by 2 bits? [2]
(e) What would be the benefits of increasing the word size of the computer? [2]
Complete the following assembly language statements, which are to be the equivalent of the above
high level language statement. The LOAD and STORE instructions imply the use of the accumulator
register.
LOAD ……………………………
……………………………………#6
STORE ………………………… [3]
140
SECTION 6 – COMMUNICATION: TECHNOLOGY AND CONSEQUENCES
Parity
Computers use either even or odd parity. In an even parity machine, the total number of ‘on’ bits in every
byte (including the parity bit) must be an even number. When data is transmitted, the parity bit is set at
the transmitting end and parity is checked at the receiving end, and if the wrong number of bits are ‘on’,
an error has occurred. In the diagram below the parity bit is the most significant bit (MSB).
01000001
Q2: The ASCII codes for P and Q are 1010000 and 1010001 respectively. In an even parity
transmission system, what will be the value of the parity bit for the characters P and Q?
Synchronous transmission
Using synchronous transmission, data is transferred at regular intervals that are timed by a clocking
signal, allowing for a constant and reliable transmission for time-sensitive data, such as real-time video
or voice. Parallel communication typically uses synchronous transmission – for example, in the CPU, the
clock emits a signal at regular intervals and transmissions along the address bus, data bus and control
bus start on a clock signal, which is shared by both sender and receiver.
6-31
Asynchronous transmission
Using asynchronous transmission, one byte at a time is sent, with each character being preceded by
a start bit and followed by a stop bit.
The start bit alerts the receiving device and synchronises the clock inside the receiver ready to receive the
character. The baud rate at the receiving end has to be set up to be the same as the sender’s baud rate
or the signal will not be received correctly. The stop bit is actually a “stop period”, which may be arbitrarily
long. This allows the receiver time to identify the next start bit and gives the receiver time to process the
data before the next value is transmitted.
A parity bit is also usually included as a check against incorrect transmission. Thus for each character
being sent, a total of 10 bits is transmitted, including the parity bit, a start bit and a stop bit. The start
bit may be a 0 or a 1, the stop bit is then a 1 or a 0 (always different). A series of electrical pulses is sent
down the line as illustrated below:
Voltage (V)
High
Low
0 0 1 0 1 0 0 1 0 1
Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Stop Parity Start
bit bit bit
Character code for ‘R’
Asynchronous transmission
162
Chapter 41 – Graphs
Chapter 41 – Graphs
Objectives
• Be aware of a graph as a data structure used to represent complex relationships
• Be familiar with typical uses for graphs
• Be able to explain the terms: graph, weighted graph, vertex/node, edge/arc, undirected graph,
directed graph
• Know how an adjacency matrix and an adjacency list may be used to represent a graph
• Be able to compare the use of adjacency matrices and adjacency lists
Definition of a graph
A graph is a set of vertices or nodes connected by edges or arcs. The edges may be one-way or
two way. In an undirected graph, all edges are bidirectional. If the edges in a graph are all one-way, the
graph is said to be a directed graph or digraph.
Bury St Edmunds
57 Framlingham
10
25 Wickham Market
45 7-41
31 56
9
Stowmarket
21
15
Ipswich Woodbridge
A
D
F E
207
Section 7 – Data structures
Implementing a graph
Two possible implementations of a graph are the adjacency matrix and the adjacency list.
A B C D E F
B
5 3 A 5 4
A 6 B 6 3
D
4
C 8
2
C D 2
F 8 E E
F
In the case of an undirected graph, the adjacency matrix will be symmetric, with the same entry in row
0 column 1 as in row 1 column 0, for example.
An unweighted graph may be represented with 1s instead of weights, in the relevant cells.
7-41
Q1: Draw an adjacency matrix to represent the weighted graph shown in Figure 41.1.
A {B:5, C:4}
B {C:6, D:3}
C {F:8}
D {E:2}
E {}
F {}
208
Chapter 47 – Graph-traversal algorithms
• In scheduling jobs where a series of tasks is to be performed, and certain tasks must be completed
before the next one begins.
• In solving problems such as mazes, which can be represented as a graph
Finding a way through a maze
A depth-first search can be used to find a way out of a maze. Junctions where there is a choice of route
in the maze are represented as nodes on a graph.
A
B A
C B
D
E
C D
E
X
Q1: (a) Redraw the graph without showing the dead ends. 8-47
(b) State the properties of this graph that makes it a tree.
(c) Complete the table below to show how the graph would be represented using an
adjacency matrix.
A B C D E X
A
B
C
D
E
X
Q2: Draw a graph representing the following maze. Show the dead ends on your graph.
A D X
B C
247
Chapter 53 – The Turing machine
Alan Turing
Alan Turing (1912–1954) was a British computer scientist and mathematician,
best known for his work at Bletchley Park during the Second World War.
While working there, he devised an early computer for breaking German 9-53
ciphers, work which probably shortened the war by two or more years and
saved countless lives.
Turing was interested in the question of computability, and the answer
to the question “Is every mathematical task computable?” In 1936 he
invented a theoretical machine, which became known as the Turing
machine, to answer this question.
Infinite tape
... 1 0 1 0 0 0 1 □ 0 1 1 □ ...
The Turing machine is an early precursor of the modern computer, with input, output and a program
which describes its behaviour. Any alphabet may be defined for the Turing machine; for example a binary
alphabet of 0, 1 and □ (representing a blank), as shown in the diagram above.
273
Section 9 – Regular languages
The finite state machine corresponding to the state transition diagram is given below.
1,1,R 1,1,R
0,0,R 1,0,L 0,0,R
Q1: Trace the computation of the Turing machine if the tape starts with the data 11 as shown below.
... □ □ 1 1 □ □ ...
S0
(You will need to draw ten representations of the tape to complete the computation.)
Transition functions
The transition rules for any Turing machine can be expressed as a transition function d. The rules are
written in the form
9-53 d (Current State, Input symbol) = (Next State, Output symbol, Movement).
Thus the rule
d (S1, 0) = (S2, 1, L)
means “IF the machine is currently in state S1 and the input symbol read from the tape is 0, THEN write a
1 to the tape, and move left and change state to S2”.
Q2: Looking at the state transition diagram above, write the transition rules for inputs of 0, 1 and □
when the machine is in state S0.
A, B + A+B
A, B * A*B
Each machine has a different program to compute the desired operation. However, the obvious problem
with this is that a different machine has to be created for each operation, which is clearly impractical.
Turing therefore came up with the idea of the Universal Turing machine, which could be used to
compute any computable sequence. He wrote: “If this machine U is supplied with the tape on the
beginning of which is written the string of quintuples separated by semicolons of some computing
machine M, then U will compute the same sequence as M.”
276
Chapter 68 – Object-oriented design principles
Team Player
Hotel Room
Q1: Specify whether each of the following describe association aggregation or composition
aggregation.
(a) Zoo and ZooAnimal
(b) RaceTrack and TrackSection
(c) Department and Teacher
353
Section 12 – OOP and functional programming
Polymorphism
Polymorphism refers to a programming language’s ability to process objects differently depending on
their class. For example, in the last chapter we looked at an application that had a superclass Animal,
and subclasses Cat and Rodent. All objects in subclasses of Animal can execute the methods
moveLeft, moveRight, which will cause the animal to move one space left or right.
Moves
Animal one space
Mouse Beaver
We might decide that a cat should move three spaces when a moveLeft or moveRight message is
received, and a Rodent should move two spaces. We can define different methods within each of the
classes to implement these moves, but keep the same method name for each class.
Defining a method with the same name and formal argument types as a method inherited from a
superclass is called overriding. In the example above, the moveLeft method in each of the Cat and
Rodent classes overrides the method in the superclass Animal.
Q2: Suppose that tom is an instance of the Cat class, and jerry is an instance of the Mouse
class. What will happen when each of these statements is executed?
12-68 tom.moveRight()
jerry.moveRight()
Q3: Looking at the diagram above, what changes do you need to make so that bertie, an instance
of the Beaver class, moves only one space when given a moveRight() message?
354
INDEX– AQA A LEVEL COMPUTER SCIENCE
Index
A asynchronous transmission, 162 breadth-first
absolute error, 385 attributes, 319, 347 search, 248
abstract data types, 188 audio bit depth, 88 traversal, 245, 246
abstraction, 52, 108 automation, 58 bridges of Königsberg, 54
data, 57 automaton, 61 browser, 305
functional, 56 bubble sort, 44, 238
problem, 57 B bus, 127
procedural, 55 backing store management, 104 address, 128
accumulator, 132, 138 Backus-Naur form, 278 control, 128
active tags, 152 bandwidth, 161 data, 128
ADC, 90 barcode reader, 149 byte, 72
adders barcodes bytecode, 112
concatenating, 387 2-D, 148
address bus, 127, 128, 135 linear, 148 C
addressing mode base case, 224 cache memory, 135
direct, 139 baud rate, 161 Caesar cipher, 96
immediate, 139 behaviours, 347 call stack, 200, 225
adjacency Big Data, 374 camera-based readers, 150
list, 208 Big-O notation, 229, 231 cardinality, 265
matrix, 208 binary carry, 78
ADT, 188 addition, 77 Cartesian product, 266
aggregation, 353 converting to and from decimal, 69 CASE, 10
agile modelling, 342 file, 31 CCD reader, 150
Alan Turing, 273 fixed point, 80 CD-ROM, 155 Index
algorithm, 2 floating point, 81 Central Processing Unit, 126
ALU, 132 multiplication, 78 check digit, 75
Amazon, 179 negative numbers, 79 checksum, 75, 292
analogue number system, 69 ciphertext, 96, 295
data, 89 subtraction, 80 CIR, 133
to digital conversion, 90 binary expression tree, 286 circular queue, 190
analysis, 34, 342 binary search, 236 class, 348
AND, 10, 144 recursive algorithm, 237 classful addressing, 308
AND gate, 115 tree, 212 classless addressing, 308
API, 313 binary search tree, 215 client-server
appending, 372 binary tree search, 238 database, 339
application layer, 300, 301 bit, 72 model, 313
Application Programming depth, 88 network, 168
Interface, 103, 313 rate, 161 clock speed, 135
application software, 102 bitmap image, 83 CMOS, 151
arithmetic logic unit, 127, 132 block-structured languages, 39 co-domain, 360
arithmetic operations, 3, 127, 143 Blu-Ray, 155 collision, 202
ARPANET, 288 BNF, 278 resolution, 204
array, 17, 19, 190 Boolean algebra, 120 Colossus computer, 106
ASCII, 73 Absorption rules, 120 colour depth, 83
assembler, 110 Associative rules, 120 comments, 3
assembly language, 108, Commutative rules, 120 commitment ordering, 340
109, 140, 142 Distributive rules, 120 compact representation, 266
association, 353 Boolean operators, 10 compare and branch
asymmetric encryption, 296 instructions, 143
391
INDEX– AQA A LEVEL COMPUTER SCIENCE
392
INDEX– AQA A LEVEL COMPUTER SCIENCE
393
N oscillator, 388 processor, 127
NAND gate, 116 overflow, 78, 386 instruction set, 138
NAT, 310 override, 354 performance, 134
natural number, 68, 265 Oyster card, 152 scheduling, 104
nested loops, 15 program
network P constructs, 8
client-server, 168 packet filters, 294 counter, 133
interface cards, 294 packet switching, 292 programming paradigm, 360
layer, 300, 301 PageRank algorithm, 209 proper subset, 266
peer-to-peer, 169 parallel data transmission, 160 protected access modifier, 356
security, 172, 294 parity, 162 protocol, 163
station, 171 bit, 74 prototype, 343
Network Address parity bit checker, 221 proxy server, 294, 295
Translation, 310, 311 partial dependency, 326 pseudocode, 2
nibble, 72 partial function application, 368 public, 348
NIC, 294 passive tags, 152 modifier, 356
node, 207 PC, 133
non-computable problems, 256 pebi, 72 Q
NOR gate, 116 peer-to-peer network, 169 quad-core processor, 134
normal form pen-type reader, 149 queue, 188
first1NF, 324 peripheral management, 105 operations, 189
second 2NF, 326 permutations, 231 Quick Response (QR) code, 148
third 3NF, 326 phishing, 299
Index normalisation, 327 piracy, 170 R
of databases, 324 pixel, 83 Radio Frequency Identification, 151
of floating point number, 382 plaintext, 96, 295 range, 79
NOT, 10, 11, 144 platform independence, 112 raster, 83
gate, 114 polymorphism, 354 rational number, 68, 265
number polynomial function, 230 real number, 265
irrational, 68 polynomial-time solution, 255 record, 29
natural, 68 POP3, 304 record locking, 340
ordinal, 68 port forwarding, 311 recursion, 224
rational, 68 Post Office Protocol (v3), 304 recursive algorithm, 237
real, 68 postfix reference variable, 349
Nyquist’s theorem, 90 expression, 284 referential transparency, 363
notation, 283 register, 127
O post-order traversal, 214, 227 regular expressions, 269
object code, 110 precedence rules, 283 regular language, 270
object-oriented programming, 347 pre-order traversal, 213, 227 rehashing, 204
one-time pad, 97 prepending, 372 relation, 323
opcode, 106, 138 primary key, 319 relational database, 320, 323
operand, 106, 138 priority queue, 192 relational operators, 8
operating system, 100, 103 private, 348 relationships, 320
operation code, 106, 138 key encryption, 296 relative error, 385
optical disk, 155 modifier, 356 REPEAT … UNTIL, 14
OR, 10, 144 problem solving strategies, 36 Representational State Transfer, 314
gate, 115 procedural programming, 347 resolution, 83
ORDER BY, 332 procedure, 21 resource management, 100
ordinal number, 68 procedure interface, 56 REST, 314
394
INDEX– AQA A LEVEL COMPUTER SCIENCE
395
INDEX– AQA A LEVEL COMPUTER SCIENCE
396
AQA AS and A Level
Computer
Science
The aim of this textbook is About the authors
to provide a detailed Pat Heathcote is a well-known
understanding of each topic and successful author of
of the new AQA A Level Computer Science textbooks.
Computer Science She has spent many years as a
specification. It is presented in teacher of A Level Computing
an accessible and interesting courses with significant
way, with many in-text examining experience. She has
questions to test students’ also worked as a programmer
understanding of the material and systems analyst, and was
and their ability to apply it. Managing Director of Payne-
Gallway Publishers until 2005.
The book is divided into 12
sections, each containing Rob Heathcote has many
roughly six chapters. Each years of experience teaching
chapter covers material that Computer Science and is
can comfortably be taught the author of several popular
in one or two lessons. It will textbooks on Computing. He
also be a useful reference and is now Managing Director of
revision guide for students PG Online, and writes and
throughout the A Level course. edits a substantial number of
Two short appendices contain the online teaching materials
A Level content that could published by the company.
be taught in the first year of
the course as an extension to
related AS topics.