0% found this document useful (0 votes)
56 views172 pages

Letts Revision

This document is a comprehensive revision and practice guide for GCSE Science and Computer Science, designed to support the national curriculum. It includes a revision guide with various learning approaches and an exam practice workbook filled with GCSE-style questions and practice papers. Key features include concise explanations, hands-on activities, and tools for reinforcing understanding of algorithms, programming, data representation, and more.

Uploaded by

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

Letts Revision

This document is a comprehensive revision and practice guide for GCSE Science and Computer Science, designed to support the national curriculum. It includes a revision guide with various learning approaches and an exam practice workbook filled with GCSE-style questions and practice papers. Key features include concise explanations, hands-on activities, and tools for reinforcing understanding of algorithms, programming, data representation, and more.

Uploaded by

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

Science

Computer
<
en /

t\
Masts ‘

Supports the
new national
curriculum
This complete revision and practice book is divided into two parts: the revision guide and the exam practice workbook.
it will reinforce all the skills on the main GCSE courses.
Whether you like to learn by seeing, hearing or doing (or a mix of all three), the revision guide uses three different approaches
to help you engage with each topic and revise in a way that suits you. The exam practice workbook is packed with GCSE-style
questions, including a complete set of practice papers, to ensure you are thoroughly prepared for your exams.

Key features
The revision guide neatly packages the GCSE course into short revision modules to make planning easy.
The workbook provides exam-style questions matched to each module, followed by a complete set of
practice papers.

<> Striking page design, images and diagrams to help you engage with the topics.

& Hands-on revision activities.

(r Download the relevant track for an audio walk-through of each module.

<> Simple, concise explanations for effective revision.

<> Keyword boxes to build vocabulary.

yw Quick tests to check your understanding of each module.

YY GCSE-style questions and practice papers.

can somaemres beproblema 10vse8 vartatieIan outsce theBuoRDutine


(orglobalvariable) =
wasting mactwe anarree
nese
4 3
3“
a]
4
6
2
3
J¢€£

4
5
Pt
ce
4
Be
[<3
°
‘zo
BBN meas
fra
\

Practice opportunities, exam-style questions Mind maps summarise the


and a complete set of practice papers for key concepts at the end of
thorough exam preparation. Answers are each topic and show how
provided to enable you to mark your own work. they are linked.

Download the FREE audio book from www.collins.co.uk/lettsGCSErevision


GCSE
Success

Science

Comp a

Revision Guide
Fundamentals of Algorithms
Module 1: Representing algorithms
Module 2: Searching algorithms
Module 3: Sorting algorithms
Mind map
Exam practice questions

Programming 1
Module 4: Data types
Module 5: Pseudocode
Module 6: Arithmetic, relational and Boolean operators in programming languages
Module 7: Flowcharts
Mind map
Exam practice questions

Programming 2
Module 8: Data structures
Module 9: Input/output and file handling
Module 10: = String handling
Module 11: |§Random number generation in a programming language
Module 12: Databases
Mind map
Exam practice questions

Programming 3
Module 13:

Module 14:

Module 15:

Exam practice questions ,::i2:ss...cece, mete ees neces


Fundamentals of Data Representation
Module 16: Number bases and binary arithmetic 0.0.0...
ccc ccceeseceseeceerseeeees
Module 17: Units of information and character Encoding..............ccccceeeeeeeeees
Module 18: miyaleestolauls(a @leplele Gi lava lela) ilebes MA aah oe
Module 19: Bere CUI
SSS cal Pca, eee rR ED ay rice Mas cc cacasvdhgacnlentndsyee
IVSTOCU AT GLY Shes Gee ee ea OR Re SE BN Sh ahis fala vests
EXE) Practice CUCSHON seem apm sume eter sna vos Ace cinsics

Computer Systems
Module 20: Hardware, software and Boolean logic
Module 21: Software classification
Module 22: Systems architecture.
Module 23: Secondary storage
Mind map
Exam practice questions

Fundamentals of Computer Networks


Module 24: Definitions and types of networks
Module 25: Network topology
Module 26: Communication protocols
Mind map
Exam practice questions

Cyber Security and Ethics


Module 27: Definition, purpose and threat
Module 28: Detecting and preventing threats
Module 29: Ethics
Module 30: Encryption
Mind map
Exam practice questions

ASCII table
Answers
Index
Algorithms
An algorithm is a process used to solve a problem or achieve a task. In computer science, sometimes a
program is used. Be careful not to confuse the two! A program is a type of algorithm, but then so is a recipe.

An algorithm:
» is aset of steps, or instructions, to complete a task. We use them all the time — we just
don't realise we are.
» is away to solve problems, or complete tasks. There are a lot of different ways in which to
complete each task, just like there are a lot of different Victoria soonge cake recipes or there
is more than one way to go to school.
is judged by whether it completes the task, or solves the problem, in the most efficient
way. An efficient algorithm only uses the resources it absolutely needs in order to
complete the task — no more, no less
» is generally made up of INPUT —- PROCESS — OUTPUT.

:JS
» is tracked using what are called trace tables, which trace the
Wi
progress of the computer through the code.

Algorithms help us tackle a range of


problems, not just computer coding. a
a
am
@
DBOS
0)
£
wed
/

=
Y
Wi
Y
aa Process and function
oe.
Yy Algorithms are generally made up of INPUT — PROCESS — OUTPUT. Keeping track of what

Ce the code is doing at any one time can be challenging, so we use trace tables, which trace the
progress of the computer through the code.

INPUT [3 PROCESS [3 OUTPUT

When you use a trace table, you go through your code as if you are the computer, writing
down the inputs, the processes and the outputs. This is an essential part of testing and can
help you see where the computer code would go wrong before you even enter it, which
saves time in class — and money in business.

Efficiency » The extent to which a task is completed in the shortest possible amount of
Module
1 code. This also relates to the amount of memory used and speed of execution of the code.
Trace tables » A template to help you follow each instruction in your program

ae ity (tC Representing algorithms


Flowcharts Trace tables
Flowcharts are a great visual way to plana A trace table allows you to work
program through a sequence of events. through an algorithm or program
Simple Burglar Alarm Set: to iron out any potential problems.

|
Output_|
Set alarm code
, Sheekte|
Consider the following ace! |
short counting algorithm: ole |
ont ; ce
OUTPUT x =
WHILE x <=3
it
a= =|
a at ee 20
PRINTy 2
ee
OUTPUT “Complete” ts
2
BSS
eae
code been Set off alarm!
entered?

Deactivate alarm

Decomposition
When you decompose a task, you break it into smaller tasks.

Decomposition: | ROOM
~ » helps you write your code because it is usually easier to write | TIDYING MY
- code for each section at a time, rather than trying to write the . 1) Clear the floor a9
whole thing in one go. So, an alarm system for your home will | 2) Move what's un
have a ‘set/unset’ program and a ‘live’ program. | the bed
> makes life a lot easier when you are testing your code | 3) Put cloth es in the
because you can test each section before you run it all 4 drawer
together. Think about the code needed to run a driverless
Car — you can see why it is a good idea to test the bits of
code (like stopping when something is in the way) before
you put the car on the road.

Abstraction eehatislan
Abstraction is the way we remove unneeded information from / algorithm?
a task so a computer can complete it. In the exam, you will ad Explain using two
need to be able to read code, or a brief, and identify the ‘real. different examples:
problem’. For example, if you are programming a driverless one in human terms, and one
car, does it matter if the car is pink or yellow? What is more referring to computers.
important is whether speed or direction is set accurately. . What do we mean by an
‘efficient algorithm’?
Make a model of a computer showing INPUT — . What are the main
PROCESS — OUTPUT, or be more ambitious components of algorithms?
and include storage! Show how data travels . How does a trace table help
through the system. with efficient code design?

Representing algorithms Module 1 ez


Searching
Searching is a basic and common task for an algorithm. For example, your phone searches
for a signal and your computer looks for an internet link. There are two main types of search
algorithm that you need to know: binary and linear.

Binary search
A binary search chooses the middle value in a sorted array, and works out whether the value
sought is higher or lower than the middle value. Then it splits the array again to check again
— is the value higher or lower than the middle value? The list is repeatedly split in half and half
and half until the item is located.

This means that the computer only ever searches half of the data, because it is either on the
correct number, or pointed at the correct half of the data that is in the array.

We use this method in our own lives, too. If you’re looking for a student in a class whose
Surname begins with H, you would not start at A.
7)
In pseudocode, the binary search algorithm is short. Follow the code through step by step:
EG. ClassList= [5,6,8,9,15] The content of the array is
so 3 INPUT A #number you're looking for inside the [] brackets
ASes :
IF (first > last) return -1; # number not found represented by -1
ELSE # identifies a comment

2) : { ignored by the computer.

ai INT mid = (first + last)/2;

6fe)) Bl:-
== means “is equal to”.
IF (value = = A[mid])
RETURN mid:
ELSE IF (value < A[mid])
BinarySearch(A, first, mid-1, value);
a Et ELSE
rr BinarySearch(A, mid+1, last, value);

in9 - The program is contained


within the {} brackets
eel -
© Another example of this is shown below:
cc)
V—) A group of students have received their test results.
To find out which student got 9, the computer would Array > A set of data
first sort these students and their grades in the left items of the same
column into grade order in the right column: type grouped together
using one identifying
Alex:ex 5 Alex:ex 5 label or identifier
Bailey: 9 Riley: 6
Chris: 8 Chris: 8
Jamie: 15 Bailey: 9
Riley: 6 Jamie: 15

In a binary search, the computer would start in the


middle, with Chris, at 8 marks. That's too low, so it
would split the top half in two, which would leave
the middle entry at Bailey, who gained 9 marks.

B&B
Module
2 Module 2 Searching algorithms
Linear search
A linear search:
» is used when you can't sort the data into any useful order, or when there are very few items
to search.
» is also known as ‘brute force’ searching. The computer searches from the first item until either the
end of the data or until the item sought is located, one by one.
» is best used when the data to be searched is very small, or is so frequently amended that sorting
is a waste of time.
> can take a really, really long time because it checks every single item, which is why it is used only
when a binary search isn’t possible or appropriate.

The pseudocode for this type of search is much more straightforward. Follow it through in the
graphic below.
The content of the array is
ClassList=[“Alex”, “Riley”, “Chris”, “Bailey”, “Jamie”] inside the [ ] brackets
INPUT A #name you're looking for
FOREACH [item in list]: The arogrami within the
eeee#ee
IF [item] = =A, FOREACH command, which

OUTPUT result stop search cblsttee Suda Rest st


examine every single entry in the
ELSE RETURN class list array

END

Binary vs linear
When selecting the most suitable search algorithm, consider these summary points:
» Data must be already sorted before a binary search can be carried out.
» A linear search can be slower as it checks every piece of data.
» With very small data sets neither method would have a particular speed advantage.
» A linear search can be completed with a shorter pseudocode sequence.

In pairs: use a suit of playing cards é{ 1. Imagine you are looking for a telephone number
— so just the spades or hearts for ie for K. Lombard in London, which of the two search
~ example — and while one of you techniques would be the best? Explain your
thinks of a card in the suit, the other answer.
one uses binary search to locate it. 2. Show how you would use binary search to find
Compare that with wild guessing to | the person with 17 marks from this group: 22, 19,
_ see the effectiveness of a systematic is glow eesp
BS search. 3. Which search technique requires data to be sorted?

neg

Searching algorithms BUCY. Cy: a


Sorting
An important part of managing data, sorting algorithms allows us to find things quickly by
putting data into some sort of order. This might be putting names into alphabetical order or
finding the cheapest online console game.

Merge sort
Merge sort is also known as ‘divide and conquer’ because, like the binary search, the merge
sort splits the data in half and works on each half in turn. The computer then sorts the smaller
groups before merging the two together again. This is rather like when we shuffle cards, only
we mess up the sort while the computer code resets it.

To complete a merge sort, the computer follows two steps.


1. It repeatedly splits the data into two halves until each ‘list’ contains only a single data item.
2. Having broken it into smaller parts, it repeatedly merges these ‘lists’ back together, this
time putting them in their required order (ascending or descending in value).

MergeSort (Array(First..Last))
BEGIN
IF Array contains only one element THEN
wi RETURN Array #already sorted

e ELSE

= Middle= ((Last + First)/2) #rounded down to the nearest integer

=ars
LeftSide = MergeSort(Array(First..Middle))
RightSide = MergeSort(Array(Middle+1..Last))

=)
Result = Merge(LeftSide, RightSide)
RETURN Result

“h ENDIF
END MergeSort
fy
ee
eoeees8segeeseses#seees2#e28e8e @
eeeeveeeeeseesvpmenerpeeeeeeee

D Bubble sort
=
aed
Bubble sort comes from the way that stones settle in a tank of bubbling water: the larger
thes stones sink to the bottom of the tank while the small ones appear to rise to the top. That is

° why a bubble sort is called a sinking sort. This is very rarely used, but it illustrates important

Vv) principles so is included in all computer science study. Its slow methodical nature means it is
normally only used for very small volumes of data. :

} A bubble sort compares the first two items, checks which one is
larger, and swaps them if necessary so that the larger is first.
} Then it checks the next pair, and so on.

» If there have been any position changes, the whole process is begun
again until the computer can go from start to finish and there are no
changes to be made. At this point the data is in descending order.

Descending » Decreasing
in number to 1 downwards,
or in value from A

Module3
E EYE Sorting algorithms
A practical example of this is worked through below.

I have a list of grades [5,6,8,9,15] and need to sort them from highest to lowest.
The computer looks at the first two: [5,6]
The second (right hand) is larger, so they are swapped [6,5]. Then the next two are checked [5,8].
Again, these need to be swapped [8,5].
The next two are [5,9] which, again, have to be changed (see how the 5 is being pushed down to the bottom) [9,5]
Finally [5,15] have to be swapped to [15,5].

In one pass, the list has been changed from [5,6,8,9,15] to [6,8,9,15,5]. The computer will have to do this
sequence again, from the start, to change the list and slowly, pass by pass, move this to [15,9,8,6,5]. The
numbers would change like this, in ELEVEN steps:
[5,6,8,9,15] [8,9,15,6,5]
/ (6:5,8,9; to] (9.8; 19iG,9] Values that are
cs [6,8,5,9,15] [9,15,8,6,5] already in the
q [6,8,9,5,15] [15,9,8,6,5] ‘right place’ don't
[6,8,9,15,5] move again.
[8,6,9,15,5]
[8,9,6,15,5]

The code for this is a lot shorter:

FOR ifrom 1 toN

FOR j from 0 to N - 1

: IF alj)
>alj +1]

SWAP (alj], alj + 1])

For the exam, you need to be able to compare and contrast these two types of sorting algorithms.

Bubbie (itt ae
Eficiontly handle big data sets?
Space used in memory
-
EE
Stable (never changes since _| Variable (splits the data in two)
items are just swapped)

"xe by ‘ag “a5 5


See tBe DyPa :
TA Se eS

In a box, mix up small 1. You need to work out the oldest person in a class
and large stones or of 20. Which would be the most appropriate of
marbles. If you shake the two sort techniques? Explain your answer. 3
them (gently) you will 2. Show how you would use bubble sort to E#
see bubble sort in create a descending list from this group: 22, 19, ht
process, as the larger 17 lS geno, rs
stones or marbles 3. Which sort technique is appropriate for large
come to the top. amounts of data?

ae , §

5
a,
ey

a
he
Son 5 * )
ae ie BE
B. Sorting algorithms MCE ce: 9
ahs a Tee ee x
Answer the following questions on a separate piece of paper.
wh
1. Complete the trace table for the algorithm below. =
number = 5
OUTPUT number
~
what
Vi
rf
FOR ifrom 1 to 3

5
number = number +3
OUTPUT number
END o
Y
aoa
eee
Wd
tSea
2.
=
6
><
ui
(8 marks)
2: ‘Decompose the task: an automatic car wash program that will wash
all vehicles from a small car to a minibus. (5 marks)
_ 3. Decompose the task: make your bedroom neat enough for an inspection. (2 marks)
e 4. Explain how decomposition helps programmers code efficiently. (3 marks)
_ 5. Explain how abstraction helps programmers to plan a coding solution to
- aproblem. (3 marks)
«6. Describe what this algorithm does.
: counter = 1
: WHILE counter < 11
-_ PRINT counter
counter = counter + 1
PRINT “All done”
2 END (2 marks)
ez Explain how the efficiency of algorithms is judged. (3 marks)
8. Compare and contrast linear and binary search algorithms. (5 marks)
. Compare and contrast merge sort and bubble sort algorithms. (3 marks)

of
Fun
alg
Exam practice questions Batre le ies EY
Main sais types Programming concepts
a Data types allow us to categorise the range There are three main constructs within
of data that is used in programs. Computer coding: sequence, iteration (or repetition)
programs treat different types of data in and selection (or choice).
different ways.
Constructs
Here are the main data types:
Sequence is the simplest form, or
Integer is a whole number, no decimal point structure, of computer code. The computer
or fraction, no letters. It might be used to moves from one statement to the next
define a count for a loop — you can only in sequence. There are no loops, no
perform an instruction a whole number of branches, and no instructions can be

i =
times, not 2% times, for example. (It’s a skipped.
term you might have met in maths.)
Boolean data is digital: yes/no; on/off; true/
false. This is essential for loops — for example,
is the temperature over a set point? Has the Sequence structure follows one path from
loop been run x number of times? (You should start to finish.
have met this as part of your work learning
Iteration (or repetition) refers to the
how to search the Internet effectively.)
number of times a computer passes
Real data tries to reflect ‘real’ numbers, so
through a set of instructions. One iteration
this includes decimals: these are sometimes
is once through, and would be shown
described as ‘float’ numbers because
in a sequence-based code. We tend to
the number of decimal places can vary
use this term when referring to loops in
depending on the level of detail needed. It
code — for example, how many times (or
might be used to show the weight of an item
iterations) will the computer complete this
in kilos, or fractions of distance measurement.
section of a code? There are two forms
/ Being specific about 4.75 kilos, not 5, for
of iteration: definite (also called count
example, could make a difference for dosage
control) sets the specific number of times
of medication or fertiliser.
an instruction must be performed and
Character is any one of the letters and indefinite (also called condition control)
symbols on a keyboard. You can also define allows for a variable number of times to
a number as a character when you don't perform the instruction, dependent on
want to use it for a mathematical operation. another factor, such as temperature, or
String can hold any number of © ; weight or time.

Data
types~ symbol. This can include name, address
alphanumeric characters: text, number,
Selection (or choice) is best
demonstrated using the ‘IF, THEN, ELSE’
and telephone number entries, for
%. description. If the temperature is 14
~ example. Although a telephone number iis
degrees Celsius, then turn on the boiler,
constructed of numbers, we don't use it for =
else leave the boiler off. Most computer
mathematical operations: itiseffectively an
code involves some element of selection.
adidiess, Xe)
& :isstored asa string. ae

Pacer Bas Toeinines =


27a
eo
0-98
¢,)
O.

pee | Sex=
Selection allows for a decision to change
the flow of the program.
Bs
ee
Saal
ie

Module4
Ee
() 0) ee en as Se —
, cet
By 3

-_
er
a: PS _
Fae
a.
HO sae whee NS ep snd reer Rh EPR MRR SMP, eater renee Nips. a wT Repsaicc e0
we Pea mas. les? 2h we a hie a Ncod Paes ae aot . 4

oo «=
Sequence oo « ae
axa ®
aos =

Name <- USERINPUT FOR i —1T0 10 IF age < 15 THEN What To Wear
OUTPUT “Hi,”Name OUTPUT i age <— myVar + 1 Main Decision — is it a school
OUTPUT “Press x to exit.” |ENDFOR ELSE OUTPUT age dau?
ENDIF Ais.ita ‘non-uniform’
Examples of codes that reflect the three main principles
day?
Both iteration and selection can be used in nested forms, which
ki
i4 b. Is the weather ¢ old?
3
;
e
mean that more than one loop or decision is ‘inside’ a larger part Is the weather wet? aes
of the code.
CG
d. Dol have games/ pe/s
science today?
In computer terms, the nested versions look neater than the DE
A
—— Ca E : ei , oe

longer sequences would: 2 Nested selection in human terms fa |


NESTED ITERATION NESTED SELECTION “a \ Tepes
» |WHILE Temp < 20 IF Name="Fred” Then
> |...Do Something ... Do Something . -
© |FORI<-1T0 10 IF LastName = “Flintstone” Daily Operation
», |... Do Something else ... Do Something else WHILE at School
| |ENDFOR ENDIF Go to location of schoo!
° ...More tasks ... More tasks For Classes = | to 6
: ENDWHILE ENDIF Go to classes
i ENDFOR
| Other statement types Go to any af
ter-school

The main other statement types to know are: variable clubs


declaration, constant declaration, assignment and
subroutine (also called procedure or function).
oi ai atts cee
Variable declaration is when you allocate a memory space, Nested iteration in human terms
aname and/or value to a variable. Variables by definition can
change through the process of the program.
Constant declaration is when you allocate a name to a value. 1. What is a
Usually this is then irrevocable: you cannot change the value or Boolean data
the name once declared without editing the code itself. type?
Assignment means assigning a value to a variable, such as 2. Give an example
Name=“Fred”. Commonly, the = sign is used for assignment of a value. of an integer.
Names (or identifiers) are assigned to constants and variables 3. What is iteration and how
to make it easier for the human programmer to read, create and might use of iteration
follow the code. The computer doesn’t change its response to the e help a programmer
name of an allocation unless it is a key word for that programming 2 writing code for a
_ language, but it makes sense to the programmer if the username « greenhouse temperature
entered is allocated to a variable called something like UserName. ae ‘ control system?
a... as
es\ ae X \ ; 4 hae?

Indefinite » Variable and defined by another factor, such as ‘while temperature above
20°C, hold the window open’
Nested » When you put one element ‘inside’ another, such as ‘putting on your blazer’ is
‘inside’ ‘getting ready for school’
Declaration » When you ‘declare’ something you define it, such as ‘AgelnDays = AGE x 365’
Identifier » The way an element of the code (variable, constant or subroutine) is labelled

modules [EE
Seni PeDE aSS eae
E OSS © * 3 Ee

Using pseudocode
=; Pseudocode is the name we give to a shared language that
coders understand and use for planning programs before
beginning the coding. Computers cannot understand it, but it is not
simple English either: it is a formalised way of writing that means
‘*, coders from all over the world will be able to make sense of it.

. | In addition to established languages like Python or Java, all


= | exam boards will have their own pseudocode ‘dictionary’ that
= sds
=)
5* FI
ear
will cover specifics that they expect. Make sure you have a copy
nar
of this dictionary — you'll need it for your revision.
eat
sak xe
Lever

Pm: If we used natural (or ‘normal’) English it would be too verbose —


~ there would be too many words. Using one particular ‘high level’
language would make us too focused on the structure of that
language rather than on a way to solve the task.

= Characteristics of pseudocode
» Always starts with the name of the program
» Made up of a sequence of statements or steps
» Each statement is written on a separate line
> Statements are written in simple English
> Keywords and indentation are used to identify separate
sections of the code
> No fixed syntax (so you don’t have to worry about semi-colons
FE or brackets)

Examples of pseudocode
1. Calculate the area of a rectangle. INPUT HeightOfRectangle

Pseudocode INPUT WidthOfRectangle


AREA = HeightOfRectangle * WidthOfRectangle
DISPLAY AREA
Use CAPITAL letters to help with variable names
END

Module
5

>.
: EB
te:ss
=
2 Module
-_
~
pid eZ
_—
OE. a ‘ mf a ' . ha “e gt a ee ; rs

LGLILE : ge FPR? a Pte o ; Lt SP

2. Create code that identifies whether a student


has passed or failed a test.

lf a student scores 50 or more then they pass. IF Score >= 50 THEN


PRINT “Passed”
ELSE
PRINT “Failed”
ENDIF

IF HoursWorked > NormalHours THEN


Wage= (2 * (HoursWorked — NormalHours) +
——~"HoursWorked)* HourlyRate
ELSE
Wage = HoursWorked * HourlyRate
ENDIF

Common commands in pseudocode


IF Something THEN do something else ENDIF
WHILE Something do something else ENDWHILE
FOR this is something incremented TO something else

Pseudocode » The language used to construct


programs in theory before using the appropriate
computer language
1. Write the pseudocode for making
a cup of tea (or be ambitious and
include the option for coffee!).
. Explain the difference between
pseudocode and ‘natural’
| English.
Create flashcards to help you remember the commands . What is the difference between
and create large-scale pseudocode programs. | IF and WHILE?
Arithmetic
. INPUT HeightOfRectangle See nnics
Pelgisaehuertewetaccy We : INPUT WidthOfRectangle this fromthe
fUnStONSOFCOMEUTe. Oasis 7 - AREA= HeightOfRectangle
*WidthOfRectangle eae
arithmetic: addition, subtraction, * DISPLAY AREA BIB shows that the two
multiplication, division (real and * END AIM variables must be
multiplied together.
integer, with remainders).

: INPUT Total Score This is an


vas : : example of ‘real’
sonny: _ |: INPUT NumberOfStudents AIM division: the result
Subtraction
Stee :
> AVERAGE= Total Score /NumberOfStudents
. =
<=|JciMieiebiebaailel
could include
Multiplication : DISPLAY AVERAGE HIB decimal places
Division > END ~ The / shows that
: = the two variables
Exponent/Power A - . must be divided

Division has two refining elements — - - This is an


MOD and DIV. :A INPUT Total Score | Sane eehie
example of

:: INPUT NumberOfStudents A:B calculatioon


of f thethe calculati
MOD (short for modulo or
n
will not include
> AVERAGE= int(Total Score / NumberOfStudents) serine vl
modulus), finds the remainder after
; DISPLAY AVERAGE me The intsh
a division calculation. 13 divided > END Mie that the rem
by 2, for example, is 6 remainder 1.
The MOD operation would
therefore return 1 as a result.
DIV returns the whole integer
result of a division calculation if the
remainder is discarded. 13 divided =
/ by 2 using the MOD operation sf al a6 oy
—u Kies

Relational
The most common relational operators are ones - INPUT TotalScore
you will remember from maths. * INPUT NumberOfStudents
The symbols we use vary from language to > AVERAGE int(TotalScore/NumberOfStudents)
language, but in pseudocode they are: : IF AVERAGE > = 50
OUTPUT “We did it!”
Action
| Symbol +f
. OUTPUT “We need to try again.”
ENDIF
programming
in
Arithmetic,
Boolean
and
relational
operators - END @
ee
e@eee

Look at this. What would the program


output be if the average was 51?

Arithmetic » The calculation using formulae and/or functions within a program


Relational » Comparing two variables to come to a conclusion and act upon this

Boolean operators » Used to narrow or expand a search by combining or


excluding keywords

El
Module6é
Module 6 Arithmetic, relational and Boolean operators in programming languages
eat ed * uy ae
MMI“2 RIE
—— EI a
Ogee ' A: caus rede
itcentll Dios

Boolean INPUT StudentScores


You only need the most basic Boolean operators: INPUT NumberOfStudents
NOT, AND, and OR. What might be new for HIGHSCORE = MAXIMUM (StudentScores)

computer science is that you need to be able to LOWSCORE = MINIMUM (StudentScores)

combine these terms. AVERAGE= int(StudentScores/NumberOfScores)


IF HIGHSCORE > 85 OR AVERAGE > = 50
eeeeee Recult OUTPUT “We did it!” See how the inclusion
JAND [Both things mustapply ELSE of OR changes the
output of this code.
JOR __| One ortheother must apply OUTPUT “Not so good.”
ENDIF
END

INPUT StudentScores INPUT StudentScores


INPUT NumberOfStudents INPUT NumberOfStudents
HIGHSCORE = MAXIMUM (StudentScores) HIGHSCORE = MAXIMUM (StudentScores)
LOWSCORE = MINIMUM (StudentScores) LOWSCORE = MINIMUM (StudentScores)
AVERAGE= int(StudentScores/NumberOfScores) AVERAGE= int(StudentScores / NumberOfScores)
IF HIGHSCORE > 85 AND. AVERAGE > = 50 IF HIGHSCORE > 85 NOTLAVERAGE > = 50
OUTPUT “We did it!” See how the inclusion OUTPUT “That's quite a range of scores!”
of AND makes this code
ELSE more specific.
ELSE era
OUTPUT “Not so good.” OUTPUT “Not so big a range.” ey ee
ENDIF ENDIF of this code because the
average must NOT be
END greater than or equal to 50.
eoeeseeeseteesrseneseeeeteeeeeeege @ eeeeseeeseesg3r#khioe#e#ees8g#eseee#e#e#r#kee#ee#eee
e@eeeeeerseose@eee#*e#kees#k4¢éeekee#e#ee#egs*

Combinations

Natural English en
If it’s raining AND a school _| IF Raining AND SchoolDay OR WorkDay Raining is the main component,
day OR | have to go to work TakeTheBus then the decision is whether you
I'll take the bus, otherwise | ELSE are going to work or school.
I'll walk. Walk
ENDIF
If it’s NOT raining AND a IF NOT Raining AND SchoolDay OR WorkDay This time, if it is not raining or you
school day OR | have to go Walk have to go to work or school, you'll
to work I'll walk, otherwise ELSE take the bus, else you'll walk.
Pll take the bus. TakeTheBus
ENDIF

How would the results differ when using the MOD and DIV operators to calculate 11/2?
What is the computer output from the calculation (5+2) * (12/3)?
Write the pseudocode structure for a decision to have a cold drink if the temperature
outside is hot, and a hot drink if not.

Arithmetic, relational and Boolean operators in programming languages BL. EYS


Flowcharts
Flowcharts are used to show the stages in a process or algorithm. A flowchart is used in
other areas than computing because it clearly communicates a process without needing
specialised jargon.

The code development process usually includes creation of a flowchart since it enables the
coder to ‘see’ how the code should operate, which bits should go first, which bits can be
looped and so on.

The main components


[Shape | Purpose/Mfeaning
This is a terminator and you use it literally at the start and
START/STOP end ofthe flowchart to indicate where the whole code starts
and finishes.

This is a process box, one of the most frequently used shapes


to indicate what the computer is doing.

This is the decision box, asking a question with multiple


outcomes. They are most commonly used with a ‘yes/no’ or
‘true/false’ test but more than two choices can be offered in a
more complex flowchart.

A parallelogram is used to represent the input or output


of data in a process.

Sometimes your flowchart is simply too big to fit on one page —


these connectors are used to transfer the reader and flowchart
Flowcharts from one page to the next, linking the letters so that the A of
one page overlaps the A of the next to extend the flowchart.
An arrow shows the direction of travel of the data and the
| — program.

E
Module
7
mt YOUN" | Veena: esnaecine? —Wadiiptndanattp
pease ceroUNE re wm, 66 RT a aie NED,
y
{

Often the easiest way to understand something is to see it in E


action. Deciding whether to wear sunglasses to school can be
shown as a simple flowchart:
—mavertmaensae ‘encmnans
pA ATI RORDAIIE TRG, orn

LEAVE SUNGLASSES
BEHIND

WEAR
SUNGLASSES

Flowchart » A visual way to map step-by-


step decisions. The flow of logic and
potential results in a system
1. Design a simple flowchart showing
how to make tea and coffee.
2. Design a simple flowchart that
shows the decision to take an
umbrella if it is raining, but to leave
it behind if it is not.
Make a set of flowchart symbols using coloured 3. Design a simple flowchart to work out
paper and test each other on what each one means. whether you can stay in bed for an
Use sticky notes or sticky tape to create flowcharts extra hour, or have to go to school/
on walls or doors. college/work.
SMOM\
MOYS
Moy
vy
day ayi fo uOIWVUIqwMod Y
03 nba 40 UVYA Jaa

SNISUAapPWIVYD
weaicon
0} Juriba 40 UVY) sd
Java

suoiqoas JIIHM 40 4] Puy sdooy quapul


UV}

aur] aywivdas V U0 JuawWaqyys YVA


1a

UV
SSAT
i
jwuba

GN3@ Yum spua shumyy

wWvsbod
1vu0iyy)a¥ UVa]O0g
ON

/SU011V1 34
0}

(Sapuiwusad

amvu
Shumy
JNYIWYIUY

avi
SUVs

fo
uo1simg

YIM
aYi
UONIWAIGNS

IPOIOPVISd

An-3yUM
u01qwonEEa1ynW

aunjonsys
pean

aofaq
Yy1M) 4aHayu1 10 WWINPOW

SMOYS
uoMIppyv

ayoo
fo
SaqquOUud

ssaoud buiuuyyd
fo ywd sv yfeasn
MOT

siayyo
burpyad
€ aUd}san|W

SMOT]V
L buawiwvabodd
apoo fo yuys ayy w sy}

hq
fisva
wimnba sabunbuy) huvw SatquoUd WiW
ubis = asn uayfo Saiquoud dol
puvysiapun 03 hsvy
I]AVUVA AO YUVISUOD

aU0ISITIW
Peer |

sjwyuawvpun4
Bi Vv Sumy fo poyjawm ay : ys buq uo pasyg

buiwwvs
oe
“Z
i

Z
2 AdAdU
Whi = abunbuvy pavys

&
quawayw4s
onwiupap

bod
quvjsuoD
JO
IUVU
J]GVUVA
. JUVvy}suo) ay} saurfad sadhy

fo
. y *=

U
abuvy) uvd sajqv SHE'Z'L ‘Ba —aouanbas
G8 it-G @ 2.2 SS
4 I]AVUVA ayy saUrfad UOIWIVIIAP 3]GVUVA
xa]V ‘B'a — Buys
(Ee 8 6 es
1 Woawaya suo buiqNd

01903125
919904
Buin10g

arya]
4$14
Way
{fo
319304
NAHL

U0
WAN

“B'a

=
4]

U017VJ9}|
SUOI}IPUOD A3YO UO

ywada
‘b £

—sabaqul
asuu
‘b'a
puy
—burpuadap
=

sabuvy
31009

ayiutfad
sabuvyp)
ayutfapu]


Jahau

ar
ZS+
G:a
pu
jas
ey


ae
L6urwmwesboig

ia
If you need more space to answer the following questions, please use a separate piece
of paper.

1. Look at the code below, and answer the questions that follow:
Counter = 0
WHILE counter < 11:
Counter +=1
PRINT counter
PRINT “All done”.
a) What data type is ‘counter’? (1 mark)

b) Define the terms below referring to the code:


i) Variable (1 mark)

ii) lteration (1 mark)

iii) Algorithm (1 mark)

2. Why is it good practice to use appropriately named subroutines,


constants and variables? (2 marks)

3. What is meant by ‘assignment of variables’? (1 mark)

que
pra
Exa
4. Describe what the difference is between definite and indefinite iteration. (2 marks) .
\

f°)
s
5. Give a pseudocode example of nested selection. (3 marks)
:
:
©
bs]
6. What is the difference between AND and NOT Boolean operators? (1 mark) ©)
©
an
A.

Exam practice questions Baer elit: a


—e
Data structure neoas
Data structures in computer science allow us to store multiple pieces of data that are used
in programs. In pseudocode, and in many programming languages, arrays are indicated by
[], as in ClassGroup = [Alex, Bailey, Krishna, Jamie, Riley].
The main data types are:
Array — An array is a collection of something: for example, students in a class. Only one type
of data can be stored in an array — if you want to mix, say, names and numbers you would
have to use a list. You only need to worry about two different types of array: one-dimensional
and two-dimensional.
. Records - This is a term you will have met in your study of databases. A record is a single
instance within an array (or database), so one student's information within a class database
» would be one record. A record is used to hold different pees of data about one item.

pees of arrays
A simple array could be the names of students in a group: ¥
ClassGroup = [Alex, Bailey, Krishna, Jamie, Riley] ee
And now you could change things on this group as one group, rather than having to operate
on each individual separately, such as moving them from Year 10 to Year 11, or from Ms Smith’s
at
class to Mr Hussain’s class.
A two-dimensional array could be your class timetable or book reviews by different students,
so that each row is a different book, and each column is the review by a different student.
Now you can see how each book is reviewed by a lot of reviewers, or the type of book a
particular reviewer liked.

Of Mice and Men


Flowers for Algernon

:We could work out from this that Jamie maybe doesn’t like reading at all and that the most
popular book is Flowers for Algernon. You can also see the record structure, the template for
data storage that will most effectively do whatever you need. In this case, entries cover what
the readers have read and the names of the readers: the table structure above does that.
Often this form of structure will include key fields which are uniquely attached to each
Data
structures
record, so that if there were two students named Alex who read Of Mice and Men, we would
know that this Alex was the one we were looking for, because the key field is different.
In your school records, you will have a UPN, a Unique Pupil Number. This is your key field,
or primary key. Even if someone was born on the same day as you, with the same name and
address, they couldn't be mixed up with you.

One-dimensional array » A single


list, such as ‘red, orange, yellow,
green, blue, indigo, violet’
Two-dimensional array » An array
of arrays. Imagine it as a table or a
chess board

EH
Modules
tye: Data structures
i tte te eae ve eee i : z 5 ee
‘4 by . ' Le ae i 4 e = hd - * : ree 4)
ti : ; * Ber poe eg Dy dak geie ot dane
bine ew ok Ie
WY 4 PONS Remmi Caemest Rentiet ereacin ae «al
Poet DS wae.

BOR 1POR Re Fe", gars

Accessing items in an array 4


if
One-dimensional array |
In a one-dimensional array you can access any one of V4 i [
the contents by identifying its position within the array — Ai : Poe
remembering that the numbers start at 0! So: oy commence” — Veaimanse
Score = [2,4,6,8,10]
Output score[2]
NBR
bee

Will show 6, because 2 is at position 0, 4 is at position 1, and 6


is at position 2.

You can use a loop to update simple arrays, and cover each of
item in turn:

fe HIGH=0
Lo
ene
A FOR EACH SCORE
S IF SCORE >HIGH
: HIGH = SCORE
END
Or you can use a specific index point (/in this example) to
access specific items within the array:
O is the first position, but you could start further into the array as | have
HIGH = 0 here, by saying that you only want to work from position 5.
FOR | IN RANGE 5: (LENGTH OF SCORE) —
IF HIGH < SCORE [I]: Make your fridge into a two-
HIGH = SCORE [I] dimensional array. Sort your
END fridge shelves into ‘dairy’ on
one shelf, ‘fruit/vegetables’
= Two-dimensional array on another shelf, and so on.
> Inatwo-dimensional array you can also access items specifically,
» or traverse the entire array. On a chess board, the array would
be defined as BOARD [8,8] because there are 8 spaces in each
> row, and 8 rows. Now you can identify where each piece would
be by identifying its row and column. Computers use this form of
reference to create the images you see on your computer, phone
and television screen: each pixel is defined separately. 41. What would be an
example of a record
Now to update the data for the reading scores table at the start of
in a doctors’ surgery
this section (Krishna now rated Jane Eyre 5, as well as the other
database?
books) you would identify the row and column:
2. What would be in an array
BookScore [0] [2] = 5 of pet names?
3. How could you make a
Sia one-dimensional array
aa of pet names into a
0 |a
Jane Eyre ee ee two-dimensional array
ae1|OfMiceandMen | 6| 4 | 5 that would identify the
[2|Flowers forAlgernon|
9_ pet type?

"| Data structures By Cri Ce: ash


\ F %
x
input/output and file handling
Input/output and file handling is a technical way of describing what happens in most =
programs: some data is input, something happens to it, and the result is output. .

Think about this example:

Student name Saved onto.a file Printed onto a register


entered called THISFORM [2 list for fire drill
(INPUT) (FILE HANDLING) (OUTPUT)

Your code needs to be able to handle this sort of task. You need to be able to gain input from
the user when you need it — from a keyboard for example — process it, and output a result of the
processing. Usually, as part of your coursework, you need to be able to handle a text file. Often
these will be in .csv or .txt format.

One way of handling files is to create one from your first entries:

PROGRAM ‘CLASSGROUP’
ClassList = [“Alex”, “Riley”, “Chris”, “Bailey”, “Jamie”]
PRINT “Enter new name”
INPUT NewName
APPEND NewName TO ClassList
SAVE ClassList
3 This adds names to a
PRINT ClassList class list — a safer way
END of doing this would be to
use a copy of the class list.

oeees#eeeeeeese#eeegreeeveeee e
eee
eeees+#eesereersessereeeteree#e#setkset

Often files already exist, and need updating rather than creating. In this case, the code
above wouldn't work because it could repeatedly overwrite existing names.

PROGRAM ‘CLASSGROUP’
ClassList = [“Alex”, “Riley”, “Chris”, “Bailey”, “Jamie”]
PRINT “Enter new name or x to exit”
INPUT NewName

file
and
handling
Input/output
IF NewName = = ClassList
PRINT “Name already exists”
ELSE
IF NewName NOT x
APPEND NewName TO ClassList
SAVEAS ClassList2
PRINT ClassList2
END

This would open an original file, and update the


data with new names into a new file, with the
user able to use x to exit the program.
Module
9
Processes
Opening a file: If you are to access the contents, rather like using clothes in a suitcase, you need to
open it. In most cases, you also need to identify how you plan to use it once it is open.
Opening the class list just to read it: maybe
WORK = OPEN(CLASSLIST.csy, r)
!am checking, that the list is up to date.

Opening the class list to write to it: the old


WORK = OPEN(CLASSLIST.csv, w)
list will be replaced with this one.

WORK = OPEN(CLASSLIST.csy, a) Opening the class list just to append data to it:
there is a new student who must be added.

Opening the class list to read AND write to it.


WORK = OPEN(CLASSLIST.csy, r+) This is most convenient — but if you write to it
you replace the old one!

Considering the example of a class list shown above, the reason for accessing the data will decide on
whether to open the file in read, write, append or read and write mode.

Simply reading from a file can be done by displaying each line number from the first to the last in a
FOR loop.

OPEN (ClassList.csv,r)
FOR Eachline IN ClassList.csv
OUTPUT Eachline o
END

ib.cSv » Comma separated values: files in this format often are arrays that will easily import into
a spreadsheet or database program

.txt » ‘Text’ files that have no formatting and are easily opened in a word processing program

What is the difference


between opening a file with
write access and opening a
Mi file with read access?
Use shoeboxes and toilet rolls to create an . Why wouldn't you just open
INPUT — PROCESS (and storage) —- OUTPUT all files read and write
>} model. You can roll marbles from one shoebox access?
through to the other to demonstrate the process.

nate Diy inline i input/output and file handling Buty.


(1 Ge 25 |
4 ao ” jas -
ek ey ety eo) ee etor, Ca: 1.a es
ty yh
kaha
f

String handling
Handling strings refers to ‘groups’ of characters. There are a range of operations that you
might need to perform on strings: i,
Ces
e length » the number of characters.
e position » the location of a specified substring.
e substring » any contiguous sequence of characters within a string.
| © concatenation » the joining of strings end-to-end.
| (| e convert character to character code » conversion to ASCII code and back again for
yet example.
| e string conversion operations » changing letters from uppercase to lowercase for example.
if
eo A string is a sequence of characters in memory, just like a piece of string.

What are strings used for?


Strings are any sequence of characters, anything from phone numbers to essays, Class lists
wa =to email addresses. Manipulating them is a central task for most computer languages.

An important characteristic of each string is its length, which is the number of characters in it.
The length can be any whole number or integer.

A particularly useful string for some programming applications is the empty string, which is a
string containing no characters and thus having a length of 0. Programmers can set up this
string for error conditions, for example, and set a test of looking for whenever that string is
greater in length than O.

In Python version 3 and above, you can see we have two strings below, and | am asking it to
| identify a specific location in each one — position [0] in string 1 (i.e. the first character) and
positions [1:5] in the second (characters 2 through 6).
/

var = “Hello World!”


var2 = “Python Language Study”

handlprint(“var2[1:5], ”, var2[1:5])
print(“var1 [0]: ”, var1[0])

When the above code is run,


it produces the following result:

vart[0]: H
var2[1:5]: ytho

String » A sequence of characters, such as a


name or telephone number
Substring » Any identified single sequence of
characters in a string
Concatenation » Joining two strings together
end-to-end to create one longer string; ‘Sun’
and ‘shine’, for example, would become
‘sunshine’

BS
Module10
BiG‘Module 10 String handling
“e vem Le Pp i - ay we @ a =? of (veers
~ i7t a ee dy ¢ £0 + at ba kioy dl t= i }
fe yat : Od bbs AO ROS ak | a oe
Bie." . eh ot a ee 2 | ee PF ack ey <a

Pseudocode
examples
ay
a Stringname.length OR How long is the string? For example, how many students in a
*
LEN(stringname) class? (Remember strings start at position 0.)
someText="Computer Science” print(someText.length) (OCR)
| Return the position String.indexOf(n) Looks at the nth entry in a file (indexing starts at position 1)
in a string if contents of file fruit.txt is: L1 orange L2 banana L3 grape
line2 — READLINE(fruit.txt, 2) # line2 is “L2 banana”
Return the substring | Stringname. Substrings start with the Oth character, and will ‘chop’ strings
data within the SubString(startingPosition, into smaller groups:
) string numberOfCharacters) CutText=”"Computer Science” print(CutText.substring(3,3)
will display ‘put’
Concatenation of String.Join OR NewString = Appends one string to another to make a longer string.
two strings String1 + String2 if contents of file fruit.txt is: L1 apple L2 banana L3 clementine
and contents of file veg.txt is: S1 potatoes S2 celery S3 pepper
Can also sometimes
include: , and & Then shopping.txt = fruit.txt + veg.txt to create a shopping
list that includes both entries. note + does not work as a
mathematical function

Convert string to Int(string) Changes the string into an integer. You might need this if you
integer are working out ages or scores.
Convert integer to Str(integer) Turns the integer into a string — such as a telephone number.
string
Convert string to Float(string) You may remember about ‘floating’ decimal places — ‘float’ is |
real also a Python command you might recognise. 1% Bi
Convert real to Str(variable) You can also change the decimal number into a string, such ce .
string as an IP address. a:
Convert content of | String.toUpper(inString) |Changes to content of the string to all upper case letters. .%
string to upper case re y?
Convert content of | String.toLower(inString) |Changes the content of the string to all lower case letters. ag
string to lower case 7 a

Comparison of Stremp(string1,string2) | This is a Boolean comparison, returning 1 ifidenticalandOQ |


content of two strings if not. ™
%

4 x
e &

. Create a table that shows the commands to


change one piece of data (such as a weight or
date of birth) into different data types.
. Think of two different reasons why knowing the
Use different colour threads ASCII code of a character would be useful.
to create a literal string and . Ifa textfile contains ‘GCSE Computer Science’
show how APPEND or + can what would be output by print(textfile. substring(13,3)?
extend the string.

a F ¢ - » 4

i M4
| String handling BCE
y ph ote ee rem x [,. 4 ia :. i
%
»|
Truly random numbers are hard to come by for humans: we
tend to stick to patterns. When we talk about random numbers
we are often really referring to chance — that there is a uniform
distribution of, say, flowers in a meadow. Of course, this isn’t
really the case, because the flowers will go where the conditions
are best, rather than spacing themselves out evenly.

Computers use random numbers in commercial, educational


and scientific systems across the world; from gaming,
cryptography, gambling and medical simulations. A series
of truly random numbers could be of any size and extremely
id difficult for a computer to reproduce. Pseudorandom numbers
3) are computer generated and calculated to appear to be random
© but are repeatable.
Eom)

c r= aM
* & Selecting random numbers
In pseudocode, random numbers are selected using the term
RANDOM

Var <— Random(1—100) would produce a random number within


the range 1-100

In Python version 3, the code looks like:

#Random Number between 1 and 100


import random
print (random.randrange(1,100))

tr: ehi Random number generation in a programming language


WAY 3« “Fos a 7 ding ~t = ee
Secure encryption and
random numbers
m Encryption services, used in everything from banking to private
4 messaging systems, scramble data so that it can only be
. read with an associated encryption key. The algorithms that
| generate these keys use random numbers or, more specifically,
pseudorandom numbers to prevent them from being calculated
m™ by those wanting to crack the encryption.

Pseudorandom » Number selection that


follows a rule rather than offering numbers on
a truly random basis

1. Identify industries where pseudorandom


numbers are used.
2. Why could a truly random number generator
cause problems for a programmer?

Use numbered ping pong balls to create your own


random and pseudorandom number generator.
(Remember to put the selected ping pong ball back
for random numbers.)

a res, % ra *
i programming language
andom enld tlgeneration ina Module 11 [> fi
Introduction to databases |
Relational databases hold data in a structured format that allows it to be readily searched hee:
and processed by the computer using algorithms. A good example of structured data is data
held on a spreadsheet where every cell is addressable and identifiable and data can be
sorted by multiple criteria. In databases, however, the structures are clear: called records and
fields, they manage the data in a fashion that allows the program to search, update and edit,
delete and report back on the contents in a speedy and effective way.

SQL (Structured Query Language) is a language designed to work with relational databases.

In simple terms, unstructured data is the opposite. Computers are not as effective at dealing
with unstructured data: this is something humans do better. An example of unstructured data
is the content of an email message, which is difficult to categorise into a table.

Components of databases
Databases have two main elements: the part that actually holds the data and ke

l
it the DBMS (database management system) that is used by applications to 12
sie
ie
t
access that data. It is the DBMS that enforces the structure, ensuring that:
» all relationships between data are maintained (so everyone who started the day in class
7W ends the day in class 7W unless there’s a deliberate action to move them)
» all data is stored correctly and rules are not violated (So no one in class 7W is 64-years-old)
» all data is recoverable to a safe point in the case of a disaster (keeping backups). &,
Although there are a number of different ways to organise data, over time relational databases
have proved to be one of the most powerful. In relational databases, data is held in tables which
represent a set of items such as employees. Each table is constructed in columns and rows:
Each of the titles here refers to a field within the table.
Fr

This is a single Students’ database — record for Alex Hussain


table from inside the -
students’ database
concen UniquePupilNumber (UPN)

eae
33 [Sexy gy" ee oF a eee

|FormGroup”
3) eae Eu om cla ea
You can see a UniquePupilNumber is allocated to every student. This means that no matter how
® many Alex Hussains there are in the school, or in the country, this one is the only one with that
4 number, so we can use that number to check we are using the correct data.

a —

1. What is the relationship between Alex’s FormGroup entry and the


FormGroup table?
Databases
Ceye(ti
(ae 2. What is the difference between a record and a field?

a
+ :*
~
2
‘Module 12
eae” an
47 :.,
a
em
_
ee

The technical name for the field that we guarantee is unique to each record is primary key. Often
when designing database tables, we will include an ID field automatically, and relational database
programs such as Microsoft Access® automatically include this field whenever you create a table.

So far this table has very little detail. The rest of Alex’s class could be added without a common link but
these would be contained in unrelated tables. A new table called FormGroups could be set up with the
FormGroup (EH) field used as a link between them. Links between tables using common fields are the
power of relational databases.

When more than one table is used then foreign keys can appear: this is a field in one table but also
a primary key in another. In the case of Alex, her UPN is a primary key in this table, but might be also
included in a class table for each of her subject classes, so would be a foreign key in those tables.

ENGLISH CLASS ALEX HUSSAIN SCIENCE CLASS


STUDENTNUMBER (fkey) UPN AS38Q87FH912WW (pkey) STUDENTNUMBER (fkey)

< ae <9) ea

Bectionships |in a relational database


There are three relationships within a relational database:

One-to-one — This is when each entry in our student table has only one relationship in another table.
Generally, we don’t use one-to-one relationships much because if there is only one link, that data could
often be held on the single table.

One-to-many - This is the most common type of relationship: each record in one table links to one or
more records in another table, but each record in the second table links to only one record in the first
table. Looking at Alex's table, while she has only one form group, that form group will have more than
one student. is

Many-to-many -— This is when each record in one table links to one or more in the second, and vice
versa. An example here would be Alex’s teachers: each teacher may teach more than one subject
and each subject may be taught by more than one teacher.

Setting up these tables is an art in itself of decomposition: breaking down a task into smaller tasks
so that a computer can process more effectively. This also applies to databases — in this context you
decompose your data into multiple tables, to limit duplication of data entry and storage as far as possible.

Structured » Some sort of organisation


Field » A. gle unit of data stored about an entity, stored with other fields to create a
record. An example would be ‘name’
SQL » Structured Query Language, used to process the data held in relational databases
Unstructured » No clear method of organising to the level of structured data
DBMS » Database Management System
Relational database » A database that holds datain a structured format identifying links
between fields
Primary key » A field with contents unique to each record, enabling otherwise identical
data records to still be separated and processed accurately, such as an account number
- Foreign key » A foreign key is a primary key in one table, and included in another linked table
Decomposition » You decompose your data into multiple tables, to limit duplication of data
entry and storage as far as possible

Module12[El
+


If you need more space to answer the following questions, please use a separate piece
of paper.

1. Describe the difference between a one-dimensional array and a


two-dimensional array, with an example. (4 marks)

2. Read and answer the questions about the following table in a relational database.

[Employee number [LastName [Rank


_[Room]Shit |
Manager

a) Identify a record in this table. (1 mark)

b) Which of the data would be best suited to being a primary key?


Give a reason for your answer. (2 marks)

c) What would be a reasonable field size for LastName? Give a reason


for your answer. (2 marks)

3. A programmer is developing a web-based lending library. She has to


decide between using a text file and a relational database to store the data
that is needed for the library stock.
Which would be the most appropriate and why? (4 marks)

4. |In7-bit ASCII, what is this message? ,


01000001 01010011 01000011 01001001 01001001 00001010 01000011
01001111 01000100 01000101 (3 marks)

5. What limitation of ASCII is overcome by Unicode? (2 marks)

que
prac
el
Exa
yas
=
——

Exam practice questions Bagot leit:


aa
Ye

=) Subroutines and structured programming


E Subroutines are blocks of code that can be put anywhere in a
= program and are ‘called’ in the body of the code just by naming ™,

= them. Functions and procedures are both examples of subroutines; an =)


6ae a function returns a value, a procedure
: j Code written without
ae |
, 4
—-
a

om does not — it performs a task, but doesn't FRFRNIRRyIIGRENGarNselrae

)ea send any result back to the user.


They are both part of a whole approach to
‘spaghetti code’ because
it is ich longer!
‘WiiaiiamillenaliialSg
2. coding called structured programming.
o
dmesa Breaking any big task

5
fe 3
into Little ones (Aecom-
position) makes it more
achievable.
Updating the code is made
easier as subroutines can
be edited individually.
"J
3
th
ad
WV
a ©]

=
G
Wi
4
~
< Using code modules or subroutines (one for
each part of the task) makes it easy to see which
5 part of the code does a specific task.

°ma
2 Advantages of subroutines
~.
Wi
/

Iteration: the code can be written once, then used again. An example of this is the drain

oe
) or spin cycle on a washing machine: only written once, but used a number of times. In the
controller code, there will be one set of instructions to control the action, often either at the
< start or end of the main code, and within the main code there will be the instruction ‘spin’ or

ho
Ld
‘drain’ and this will call that subroutine into play. ee

ww
3
matter how many times you need it, your code can be considerably shorter.
"So

)Sow module — or subroutine — at a time. ie


You can access and use any variable from your main code without having to redefine it, so
ed
if we use the spin cycle example again, the SpinSpeed variable might be 800 rpm at one
= point in the program, and the subroutine will use that. Then, when the controller returns to
the main code after running that subroutine, SoinSpeed might be increased to 1200 — and
the subroutine will use that.

Programmers take note:


When using structured programming | ¢ Code using subroutines isn’t linear so they can be
and subroutines it’s important to placed at any point within a program.
remember the following: e Subroutines need to be clearly identifiable.
e Planning ahead is really important.

Fi
Module
13 Wty. ITT ci. Introduction to subroutines and structured programming
Translators — usually included within programming software — convert high-level language into low-level
language (machine code). There are three types of translator: assemblers, interpreters or compilers.

Advantages Disadvantages
Assembler An assembler translates This is far closer to Very device specific with
assembly language into the machine code, so __| limited instructions available.
machine code (also there are fewer errors in |More difficult to code and
Known as source code). translation. complex tasks require long
programs.
Compiler A compiler translates the | This is much faster than | It can be difficult to test
whole program that the running interpreted individual lines of compiled
programmer has written code, since once it code compared to interpreted
into machine code in one | has been compiled it is |languages because you only
sweep before the program | done. get to know the errors after
is run. the whole program has been
compiled.
Interpreter An interpreter translates Interpreted code will Running this can take a
code written by show an error as soon | lot longer than compiled
programmers into as it hits a problem, so |code, and since the code is
machine code, it is easier to debug interpreted one line at a time,
instruction by instruction | than compiled code. each time you run it you have
as the computer operates to interpret it again.
it, not all at once.

High-level language > Programming


languages that resemble natural language
in their structure and syntax. Examples
include Java and Python. For a computer
to understand and run it the program must
be compiled into machine language

Low-level language > Written to provide


instructions directly to a processor.
Examples include assembly and machine
code and although fast and efficient they
are difficult to learn

| 1. A games console, for example, will use subroutines to


walking and running to see how 3 open the disc tray, turn on LED lights or play a jingle
these activities are also made up 2 when turned on. Can you identify other household
of subroutines. my appliances or devices that also use subroutines?
— | For each of the devices or appliances you have listed,
what operations might the subroutines do? Use the
~&-4 games console example to guide you.
r F P=, Se
. 7 ' ¢- ot a rs
;- : oe
=a

Introduction to subroutines and structured programming HUClUCRE! 35


Parameters
In strictly formal terms a parameter is a variable. They are sometimes called arguments.

In pSeudocode, the general practice is that subroutines are kept at the end of the code. The
syntax for subroutines is straightforward: programs always begin with ‘program name’ and
subroutines start with either <sub> or <proc> (or <procedure>) followed by its name and
parameters.

SUB NAME (parameters)


do something
ENDSUB

Wi
Y The parameter defines how the rest of the subroutine operates.

=
~
Example:
lf a tree grows 20 cm per year, then the subroutine

5 for calculating the height of the tree would be

°mae Height(AgeOfTree) = 20 * (AgeOfTree). The ‘20’ is the


parameter: it controls the rest of the process.

2
=Oy)
A more mathematical example could be to draw a graph
showing the grades achieved by a class of students:
SUB Graph(x,y)
"Oo Where the x and y values are set or calculated elsewhere

= in the program.

6 When a subroutine has input parameters like the examples


above, the output of the subroutine is often affected by
a)
d
fon the values that are passed into the function. So a single
subroutine can be called many times within a program and produce a different result each time.

Y
Le A more complicated example can be seen if we go back to the washing machine code:

=
6oa
PROGRAM “WashingMachine”; SUB WashCycle
Check WaterLevel WHILE Timer <10

6 IF WaterLevel = Top TG RNG Turn drum right 30 secs

a.
WashCycle machine with water Turn drum left 30 secs
ELSE without overfilling! ENDWHILE
Fill ENDSUB ae
ENDIF and back aga
Ls SUB SpinCycle (SpinSpeed)

\
WashCycle Rt ahs Turn pump ON
SpinSpeed = 800 W iis Int (SpinSpeed)

= SpinCycle as iN Spin (SpinSpeed)

5
"oO
RinseCycle
SpinSpeed = 1200
se
jira
at IF pump dry
Stop spin

°
SpinCycle ELSE
END SpinCycle

= ENDIF
ENDSUB

36| toys
(Tl Parameters and subroutines
SUB RinseCycle
Check WaterLevel
IF WaterLevel = Top
WHILE Timer <10 Rinse Cycle, in this case, is just a"
Turn drum right 30 secs ONE rinse, but modern machines
have a different final rinse that
Turn drum left 30 secs often includes fabric softener F *
ENDWHILE a LTT aed
ye euuueaee
ELSE ana.

Fill
ENDIF
ENDSUB
END

It can sometimes. be problematic to use a variable from outside the subroutine (or global variable) so
sometimes a subroutine will use its own variables, such as the timer in the washing machine example.
This is called a local variable and is sometimes more reliable since it is only used and defined inside |
that subroutine and not affected by anything from the rest of the code.

Local variables are just used in the function where they have been declared, and once the program a
comes to an end, the local variable is erased from computer memory.

Global variables are usually defined at the start of a program, outside of any function. They can be
called or accessed from any function or subroutine at any point of the program.

Parameter » A named variable that allows a value to be passed between functions or


subroutines

~ Argument > The actual value that is passed to a function or subroutine

Global » When referring to a variable, this identifies one that operates in and is referenced
by anumber of elements of code across the program, such as TIME

Local » When referring to a variable, this identifies one which is only referenced within its
own subroutine or function

_ Use parameters to define how a friend 1. In the washing machine code, is the
~ moves or performs a task — tidying their room WaterLevel variable global or local?
f angrily or brushing their hair twenty times, for 2. Why are global variables sometimes
ex problematic?

subroutisnes MC MCRLM 37°


andter
Parame
Validation and Suppose | am creating a social media site
and | want to make sure that no one aged
authentication under13 takes part. The simplest way of
To make your code robust and secure, you setting this up looks something like:
need to be able to include validation and
authentication routines as part of your PROGRAM ‘AGECHECK'
process. OUTPUT “ENTER YOUR AGE”
IF AGE => 13
Validation OUTPUT “WELCOME!”
ELSE
Validation checks what you need to know,
OUTPUT “TOO YOUNG!”
include:
END
» Checking that a user has entered any
data
>» Checking that data entered is within a Authentication
set range
It doesn't check that you are telling The only authentication checks that you
the truth — just that you know the need to know focus on are username and
answer it is looking for! Checking for
the truth is verification
password.

programming Simple WHILE routines would ensure that

Yne Verification checks what you need to


your code fulfils this requirement.

5Ww know, including:


» Double entry — entering the data twice —
USERNAME = “FRED” .
OUTPUT “ENTER YOUR USERNAME”

YWi often by two different people to ensure


no crossover — and comparing the two
WHILE USERNAME = “FRED”
OUTPUT “INCORRECT USERNAME”
"oO
copies. This effectively doubles the ENDWHILE

=
workload, and costs more too. OUTPUT “WELCOME, FRED!”

6
Proofreading data — this method involves END
someone checking the data entered
ye against the original document. This is
) also time consuming and costly.
5
2
° Testing
ec Testing takes place after creating any program to see if it meets its original specification and
is fully functional. This is done through using test data from across the expected range as
well as invalid data.

You must use a clear range of test data, and be able to justify your choices.
Lf)
evaa_|pemen sedi [
Type of Example (checking age | Reasoning
\

= Normal or 15,18 Part of the ‘normal’ range and should be accepted.


S
"oO
Renee: |
Extreme or
a
14,19
a Tests that the original check was set up accurately.
Right at the edge of the range, so checks that

° feeiael
Erroneous
ae
FRED
you've used => rather than just >.
Checks that the code is strong enough to withstand ;
= (or invalid) input that results if the user is malicious or is not
paying attention.

38 |Wty ITE Robust and secure programming


There are three types of error you may encounter:
SYNTAX errors These occur when the programmer fails to obey one of the grammar rules of the programming language they are
using. This could be putting capital letters where they don’t belong
RUNTIME errors | A program running that comes across a problem it cannot resolve will throw, or stop with, a runtime error
Programming errors, hardware malfunctions or errors when accessing computer memory can cause this
LOGIC errors These can be the most difficult kind of errors to detect and fix, because often there is no obvious error within the code
The program will run successfully, but will produce incorrect results

Language classification
There are a range of programming languages, all of which fit into two categories:
High-level languages are closest to human language, and are the most recently developed. They
need a compiler because the computer doesn’t understand them.
Low-level languages are closest to the way the computer operates, with direct commands the
computer understands.
High-level languages Low-level languages
Easier to read because they are close to human language. Hard to read because they are closer to computer code than human
language.
Most code is written in these because they can be designed | Only specific tasks are written in these because they are complex to
for a specific purpose and are easier to use. operate.
Easier to learn because they are closer to the way we speak. | Harder to learn because they are not in a familiar structure.
Used to control software more than hardware: you can control |Used to control hardware rather than software: you need to know the .
many computers using the same language. computer for which you are coding.
__ | Examples: Java, Visual Basic, BASIC, the C family, Pascal, Examples: machine code is the lowest level language, and the only
Python. : one that the computer can handle without any intervention. The next
is assembly language, which is a little closer to human language. True
machine code is binary!

Each processor (or chip) has its own machine code instruction set, which is why if you want to use
machine code you have to know the machine! The few people who still use assembly language are
those who work in designing software for embedded systems (such as a sat nav in a car) or for
controlling specific hardware, such as writing device drivers.

Validation » Checks that data is reasonable, within any set limits. It does not check that
something is ‘true’
Authentication » The process of identifying a user accessing a system or program,
normally through a username and password
Verification » Checks that something is true. This is hard for a computer to do, since as yet
we do not have reliable ways to tell if someone is being honest
Embedded systems » A computer system with a dedicated function within a larger system,
typically an electrical or mechanical system

1. The code below checks for an age entry of greater than 13.

al PROGRAM ‘AGECHECK’ a) Change this to look for a date of birth instead of


OUTPUT “ENTER YOUR AGE” a set age.
IF AGE>13 b) What difference would be made if you changed
OUTPUT “WELCOME!” the IF statement to ‘IF AGE =>13’?
ELSE c) Note how this automatically checks for no entry
OUTPUT “TOO YOUNG!” at all. How does this show the weakness of this
END sort of validation?

Robust and secure programming BCL CST 39 |


bursa [0 10] v sayVL a
apoo uivu ay} hq burysal -as paydanov aq Was pnoys yng sabpa ayy
pabuvyps av siajamvind /sajquun fi : “i qw — vp Mvpunog 10 awias}xJ
I}GV1]AAUN IG UWI Sid}AWADAVd
A UIYIIM — BVP JU
A 0}
2
SIOUDASaU nOGwV JIVXd
oi /
yaau os mnogu sawn apod
burwwvsbO1d
yaov| das aq 0} spaau JV} au1ynosgns SOUNNIINAIS aeasn U1 aap ay}
ayi isuf— 190] aq uw saywpdn Buimouy U0 Juapuadap

abvunbuv
“pasn MyUOWWMOI JON

ee
Ayquiassyv
Sianup

aniirap
yuoourng

|oe
1903-07

4SaMO]
yova sjaaw apod ayifo ywud wym sabuquvapy

PUT

ysodubis sauzqnoignis 10 SajvipOW

S1
SaUO W191 49 juuss ybonosyy Ls a GY havuig — apod
Sv} b1q ay} 2321 AWAOD 0} J91SVF IUIYIVUA JS9MOT
hyjaywivdas 4sv} wus uorvorfissv9
yava DUIPOI PUY SaUo JayJWWS 07U1 abunbuv)
sysvy abiv} Buisodwmosap suvaw
nsug oud
WwISd 'Sa}awWvxI
Sayvsado IUINIOAGNS VY MOY 10AJUOD
pasn sabunbuv}
JOMOA AdNAWAOD BAOU SPUuVvwWdd SIQ}OWIVAVA asN ‘ yana1-Y BH UOWMAOD SOW
aye : ‘ > y aqu]suwy 0} sBY
apo ajdus
JaIndwoo asnvoaq
UvY1 BUIPOD aOW S$ay4V1 SAW19W10S
U01}VJaA0 U1 AIMO]S
PVIA 01 ABPIVY SIW1}IW0S
burwiwysbold
papaau aurdrvsip-fjas wow YInW\ sabvyuvapysid SaUTNOIGUS UNIS PUY ISNGOY abunbuv}
UVWNY, 0} 3S0]D
IYO IY U1 AIYMasja Jas SA]FVUVA as

ing 3
SUIS JUNPIMPU1 3$9} 0} A91SVF sabvyuvapy c
syybu ssaoov shyiquep
YuorYInAwISUA abuvs WIYNIM S1 YIP avq s1 vy ayy Wuyfuod 0} VIP
syayo — UO1UPI]!VA sysayo — uO1IwIYfUaA Gu ayy siaqua sasn VY
syvaya — UOTWWITUIaYyINnNYy
U01}V49}]|
dew puiy Bac
If you need more space to answer the following questions, please use a separate piece
of paper.

1. Explain the advantages of using subroutines in programs. (4 marks)

2. Explain the advantages of the structured approach to programming. (3 marks)

3. Why is it good practice to use local variables? (3 marks)

4. Describe the use of parameters to pass data within programs. (3 marks)

5. What is the difference between data validation and data verification? (4 marks)

6. What rules should test data follow? Give reasons for your answer. (6 marks)

7% Explain the main differences between low-level and high-level languages. (6 marks)
eT EE Eee EEO

que
pra
dex
Exa
Exam practice questions Borie Titi: pe at |
Be 10101010 1010
7
a ee |
a a .

Number Baas tyae in the different


You need to be comfortable with three bases
number bases:
Whatever the base, when you are counting
1. Decimal (base 10)
up you move one space to the left when
ic 2. Binary (base 2)
you reach the number of that base. So
3. Hexadecimal (base 16)
mm we move to tens when we reach 10.in
Decimal is the base you will probably Mm decimal, we move to 2 when we reach 2 in
recognise most easily. m =6binary, we move to 16 when we reach 16 in
hexadecimal. You need to be able to convert
thmetAllcomputers
computers use binary to function —
pmeyes:
are basically a set of switches
each of these bases into one of the others.

which can be either ‘on’ or ‘off’, represented § Predicting the sequence is easier if you look
by 0 for ‘off’ and 1 for ‘on’. Counting in at each one in detail. Base 10 would look like:
binary is easy once you see the pattern.
Most exam boards focus on 8-bit
Each time the numbers move to the left,
structures, so we'll use that here. This
the value increases by a power of 10, so

ari binary, or FF in hexadecimal — and you


inary
means the highest numbers you will have
10 is ten times 1, 100 is ten times 10, 1000
to face are 255 in decimal, 1111 1111 in 3
is ten times 100.
a
don't need to worry about decimal places. . Base 2 looks like:

Each hexadecimal digit represents 4 bits |128 |64] 32] 16] 8[4] 2[1
(or a nibble), so this is more human-friendly Each time the numbers move to the left, the
<a:
LS than binary. value increases by a power of 2, so 2 is two
times 1, 4 is two times 2, 8 is two times 4.

/
Base 16 looks like:

Each time the numbers move to the left,


the value increases by a power of 16, so
7 * 16 is sixteen times 1, 256 is sixteen times
i ~ - P 16, 4096 is sixteen times 256.

Simple conversions in each base: side by side


[Decimal__|Binary
(| Hexadecimal |
Whole Using base 10: Using the first 3 base 16 blocks:
decimal
Dee 128 |64|32 16] 8 |4]2 |1|
0 [4 fofotifoj1 jo and the hexadecimal number
74
64+8+2=74 system:
0,1,2,3,4,5,6,7,8,9,A,.8;6
Bie
74 converted to binary: 01001010
256 is too high to use but 16 will go
into 74. 74/16 = 4 with a remainder
of 10. The number 10 is represented
by A. |
b
and
bases
Number
Ceye(ti(-miem
Fd

|a2|Wty ITT Number bases and binary arithmetic


YY 4724 4

Js oes.” and

Binary arithmetic yT
Using the following rules, it is also possible to add 8-bit binary numbers together without converting to 0
another format. a)
Consider the following addition: 0001 0101 + 0010 1001
Work from the right and follow these basic rules:
(0+0=0), (1+0=1), (0+1=1), (1+1=0 and carry 1) and (1+1+1=1 and carry 1)
OAD TT Ost
0 7 31'0.0°4 16
ant he
carry line: ibat 1
We use leading zeros to show where the other digits are, to indicate that this is 8-bit binary.

Binary shift (arithmetic shift Logical shift


Logical shifts are more suited to logical
and logical shift)
functions and are more straightforward — bits
A ‘shift’ moves the bits held in the register which are shifted are lost (not carried over as
either to the left or right. in the example above) and the spaces created
are filled with zeros.
Arithmetic shift
a shift LEFT:
Arithmetic shifts effectively divide the
number by two for each step they shift right, Oe oS Co 2 ie
or multiply the number by 2 for each step 1 oe i
they shift left. (new 0 to show shift left)
“eee SE

Shift left (multiply by zee Logical shift RIGHT:


256 128 164 |32 |16 Decimal a eee eel
(carry
ac [i SS Oe
(new 0 to show shift right) ice al

Examples here have been controlled to ensure


that they don’t fall victim to overflow: this is
when the leftmost digit in binary arithmetic
‘falls off the end — in a 4-bit calculation, for
example, when you would need a fifth bit (e.g.
8 + 8 = 16). When this occurs it sets a flagin
1 (the old the computer and the software has to deal with
O shifted
it because the result would simply be wrong
otherwise. For us, doing binary arithmetic
on paper, we identify that this would be an
overflow result, and put the correct answer.
8-bit » A ‘bit’ is a binary digit that holds
either a ‘1’ or a ‘0’. So 8-bit is 8 of these
in a set together, also known as a byte 1. Identify one reason why
Nibble » Another word for 4-bit VW programmers often use
Leading zeros » Zeros put in positions hexadecimal, instead of binary,
left blank to the left of the first digit (to to represent numbers.
indicate binary representation in this . Put these in the correct ascending
case), such as telephone numbers sequence by size: byte, bit, nibble.
Register > A location in memory where . Add 00011010 + 0001001 in binary, and
data is stored show the decimal answer.

Number bases and binary arithmetic HCl Gar 43 |


Seas aioe

Units of informer
ing
waa YOU need to remember the basics:

A bit is the fundamental unit of storage, shown as either O or 1.


A byte is 8 bits.

ity From here you can count using the prefixes:

» Kilo—a kilobyte (kB) = 1000 bytes


» Mega-amegabyte (mB) = 1000 kB
>» Giga-a gigabyte (gB) = 1000 mB
» lTera-a i oie (tB) = 1000eae

4- bitbas3-
bit
You will remember that a bit is the smallest unit of storage: just one element — a 1 or a0. We
use these bits in bundles, or clusters, since one on its own isn’t really all that useful. 4 bits are
a nibble, 8 bits are a byte.
Using these combinations the computer stores all the data and presents for us on screen
what we require. Graphics, sound, text and numbers must all be converted into binary for the
computer to process them. They can be represented in 4- and 8-bit formats, and the basics
can be shown with graphics for example:

7
If we code 0 as white and 1 as black, we can make this image easily with 1 bit per pixel (or
square).

But black and white is limited — most graphics use more colours than this — so if we try for 2
bits per pixel we can add to this, in binary form:
1 bit per pixel: 2 possible colours So, for example:
2 bits per pixel: 4 possible colours OO stays for white
3 bits per pixel: 8 possible colours 01 becomes blue
4 bits per pixel: 16 possible colours 10 becomes green
11 becomes red

black 0,0,0 dark red 128,0,0 red 255,0,0 pink 255,0,255

0,128,128 teal green 0,128,0 J turquoise 0,255,255


dark blue 0,0,128 violet 128,0,128 blue 0,0,255

oOo [cc\an om racrmleyase Cark yellow 128,0128,0 | yellow 255,255,0 white 255,255,255

But this is still limited. 4-bit graphics use 4 bits per pixel, and 8 use 8 bits per pixel, to allow
us to show more complex colours.

LN
information
of
Units
Greta
and
character
encod
ere ctarencoding
Since we know that computers only work in binary, we need a way of translating the character set
(letters, numbers, and symbols) typed on the keyboard into something the computer can process.
The two main methods you need to know are:

Se > R emember
ber to
t count fromfromthe
the rightrightand and the
th

ASCII
ASCII stands for American Standard Code for Information Interchange. The first 32 codes (0-31) are set
aside for controlling devices like printers. 32 is a space, 33 an exclamation mark, and the codes then
follow the sequence along the top of a keyboard layout. There are a total of 128 characters represented
by ASCII.

Unicode
Unicode is an industry standard for texts encountered in most of the world’s writing systems. Unicode
uses the same codes as ASCII as far as it goes — and then extends to cover a wider range of
alphabets and special symbols, using between 1 and 4 bytes per character. You might have seen
character coding called UTF-32, which stands for Unicode Text Formatting 32, the simplest encoding.
Over 100000 code are assigned in Unicode 6.0.

Extract from code table

ee kes
Peas Make coded messages with 1s and Os
that must be decoded with some squared
ah Saki paper. Use the ASCII table at the end of
Harel the book (or a Unicode table online) to
Rares
F
help you design a message using the
Once you know one code codes rather than the letters.
you can often work out the rest.

ad
ae ee
J ty
Both of these code the character sets in a logical Led
pattern (such as all capital letters together, all
. What size (in MB or GB) is the hard
lowercase letters together, and all letters in
drive of a computer at school?
alphabetical order, all numbers in ascending order)
Convert that number into the number
so that in ASCIl, ‘A’ is 65, and ‘B’ is 66, and so on.
of bytes. For example, a 32 MB hard
drive would be 32*1024*1024 bytes —
Character set » The letters, numbers and 33554432 bytes.
symbols used on a keyboard. Different . How is Unicode an improvement on
languages, and even subjects, often have ASCII?
different character sets . lf the ASCII code for ‘A’ is 65, what is
the code for Q?

-_ Te
WS— ~
fo"

Units of information and character encoding BuCr Cay, 45 |


Representing images
A pixel is short for ‘picture element’, and is a single dot on your screen or printout.
Resolution refers to how many pixels are used per square. Low resolution
graphics are coarser and may seem ‘furry’; high resolution graphics have
more pixels per square and therefore are clearer and sharper. 18
Metadata is the additional data within the graphic that identifies the date of origin,
compression applied and the name of the owner of the product that created the image.

The resolution of a typical computer screen is 1920 pixels horizontally, and 1080 pixels
vertically, making the number of pixels shown on the screen equal to 2073600 pixels.

A common graphics file type is a bitmap. Despite being a rather large file type because it
defines every single dot in a graphic, this remains popular.

sound
d File name and
extension
Comments

The Microsoft BMP format is barely used outside Windows: it is large and unwieldy in file
size, not advised for use in web or print designs.
GIF (Graphic This was an original format and is best used for solid colours. It is a lossless format, so
Image File) even after the file has been compressed the quality remains unchanged.
JPEG (Joint Possibly the most well-known format, especially on the web, also used by mobile phone
Photographic and digital cameras, for example. A JPEG allows compression of graphics in a lossy
Experts Group) format, meaning that quality is lost as the file is increasingly compressed, but JPEGs can
also be saved in full uncompressed detail.
PNG (Portable Often used instead of one of the other two above, this can handle transparency better
Network Graphics) | than a GIF format, although the files tend to come out larger. —
TIFF Another popular graphic file format, this can also be compressed to different levels. Like
JPEG files they can be used uncompressed.

The size of a bitmap graphic uses pixels the same as a screen: in bits it is width (pixels) x
height (pixels) x depth (bits) or in bytes (width (pixels) x height (pixels) x depth (bits))/8.

The colour depth of the graphic is then expressed by the number of bits used, e.g. ‘64-bit
graphics’.

A simple 4 x 5 square shows how bitmaps Converting the black and white image into
are constructed:

Common image representation


The most common way of presenting an image is
called the RGB model — Red, Green, Blue. Each FI
pixel is encoded over 32 bits (4 bytes). The fourth ,0,

itere(ti(-mE:g
Represent
byte is called ‘alpha’ and you might have seen that
in graphics work of your own. Alpha refers to the
|Green |0,2550 =
/Pink =|255,170,170
|0,FRO

level of transparency of a graphic.

46 UCT TCE: Representing images and sound


TA LOO PME i
As a general rule, the more pixels and bits we use in a graphic, the larger the file size. Web and
games designers have to consider this in their work, since if the console, phone or computer take too
long to render the image, the user will go elsewhere. Compression can help with this, but the cost is
often the quality of the image.
Metadata adds to the amount of information communicated with the graphic — it isn’t editable so it is
sometimes used to check the accuracy of other sources. It is also increasingly a privacy issue, since
it can include GPS data identifying your location.

Metadata can include details such as the purpose of the file, its time and date of creation, the author
or owner of the software, the location on a computer where it was stored, the standards applied to the
data in the file and the file size.

Representing sound
Sound can be recorded either using digital or analogue EN ff A
equipment with analogue recording the sound waves directly
onto a magnetic tape or physical record and digital taking the
analogue signal and sampling it to a digital file. Many argue the
quality of one is better than the other but there are many variables
involved in both, from the quality of equipment used and the
sampling settings used. Standard sound is 44.1 KHz — or about
44000 samples per second.

The program takes a number of samples of the sound per second


at set intervals (called the sample rate), and works out the top and
bottom values of the analogue sound. If the sound being processed is ENP NI AS
above the halfway point, the program checks again if the sound would
still be above halfway if the first half was cut into half again, and so on.

Above is recorded as a 1, below it ‘Pure’


are sound iseis a perfect sine wave: —
"thisisknown as the sound wave.
is recorded as a 0. The number of
times this is checked is reflected in the bitrate. These questions change
the number of ‘steps’ that replace the smooth sine wave: again, as with
graphics, the more bits the better the quality — and larger the file.

Sound file sizes are calculated based on sampling rate and sample resolution:

File size (bits) = rate x resolution x seconds

Metadata » The descriptive data embedded within


the image, often called EXIF data W/
Bitmap » A way of representing graphics dot (or ad
pixel) by dot
JPEG » A common image file: Joint Photographic
Experts Group 1. What are the advantages and
Colour depth » This is defined by the number of disadvantages of using high
bits per pixel resolution graphics on a web
Analogue » Constantly variable, like someone's page?
voice instead of a light bulb, which is either on or off . Identify a situation where low
Sampling rate » The number of samples taken resolution graphics would be
per second an appropriate choice.
Sample resolution » The number of bits per sample

Representing images andsound @UCCIUCRES 47


Data compression
The concept of compression has been mentioned in relation to graphics and
sound. You need to be able to calculate the impact on file size of compression.
There are two approaches to lossless data compression you need to know:

Run Length Encoding (RLE)


RLE is a very simple form of data compression which is useful when
compressing graphics. ‘Runs’ of data with the same value are stored as a
~ single value and count, rather than as individual values.
» Anexample:
Coding the word FOOTBALL, this would become 1F20111B1A2L. When the
first digit of each pair is the frequency, and the second is the value.
The ‘H’ could be held, uncompressed, as 10011001111110011001
Using RLE, this can be compressed to 112021206120212011
because the first digit of each pair is the frequency, and the second is
the value.

This dark square could be held, uncompressed, @ivaraietccenonacMiealacicnecnstelecch isteach


as 1111 111111111111 and then becomes you are ordering food with friends you might ask for
4 : i ; two coffees, not a coffee for one person and then a
16 1, which is dramatically compressed. Rateodoraneoihor

Huffman coding | Bib scic'y


The more complex method used is called Huffman coding or compression, develorped *
in 1952 by David Huffman when he was a PhD student at MIT ileal ee m
Technology). It allows for lossless compression. ‘6 ae x a
Huffman coding is based on the frequency of occurrence of an element ofdata: the more y
/
common ones are coded witha lower number of bits so that they take up less space. Codes
are stored in a code book which is created for each file. To calculate i inp
Pe size...
when data iis compressed 2“Huffman tree’ iscreated. pepaste
If you will consider the phrase ‘this is an example of a Hutimantree’ < ae a =
Huffman tree — itwilllook like this: Te ere - XP & oes

Huffman tree Total number of characters


including spaces

Fe a
SS eae oe
fiea)(_2 j[wea) [wea](2|[r=8](2 |(naa ee)
Character |p|x|1|rlulo/i|s|h|n|t|m|f|e|a|SPACE|
compression
itere(ti(-mwiea
Data Frequency |1/1/1]1/1/1/2]2}2]2/2/2/3}4}4{ 7 _|
Table offrequency |

EE todsie
A tree is built by working out the frequencies — in the table — and making the two lowest elements
into ‘leaves’ creating a parent with a frequency that is the sum of the two leaves. Pulling in the other
frequencies as you go, you build the tree until only one number remains.
This number is the root of your binary Huffman tree. To generate a Huffman code you go through the
tree to the value you want, outputting a O every time you take a left-hand branch, and a1 every time
you take a right-hand branch.
Decoding a Huffman encoding is straightforward: as you read bits in from your input data you pass
through the tree beginning at the root, taking the left-hand path if you read a O and the right-hand path
if you read a 1. When you hit a leaf, you have found the code.
While ASCII is a set length (7 bits), Huffman coding is a variable length system. Calculating the size of
the file depends on knowing the length of the code.
Coding the word FOOTBALL in the example below: L at 0; 0 at 1 (only because 0 at 0 looks odd: either
way round would work) then the other letters at F = 10; T = 11; B = 100; A = 101

By encoding the most common letters


with the smallest code, the file size can
be compressed more effectively.

If data isn’t compressed,


then the file size is calculated —
~ remembering that each digit of
~ an ASCII character set uses eS
bits plus 7 because computers
eae8-bit bytes. de
a oe &
f eeping file size small, while a
stillholding onto as much ofthe
“original content as pos: ible,is
‘thedream
of many ae

aeae
Toe dae

1. a) Use Huffman coding


to work out the
compressed size of
your name.
b) Compare that to the
Compression » Encoding the content of a file so that it size of your name in
uses less storage space and takes less time to transmit ASCII. Which is the
better choice?

module19EI
yb Jsowjybu ayy qyybu ayrys
aso} ‘1f2] ay} 0} asu| 1vn1b07
yfiys
yor

bry sow fe] 344} SO]


NIWIYIUY

‘qy bu ayy 02 O Vasu] ywonboy


afys
you
nyaiynw

yoy yfiys sq g—athg


NIWYIUY
hg
z7

abv103s fo yun
i7wiquassa JOU wyyawvpurs — 11g

SIN10]09
Ng ‘Sdaquinu Jano hsv
moqu Buimouy YUOM

wow
1axX1A
aoW
NIOSV SpuUeqxX"

=
Syiq
Jad
—PyoM
avy
U01}V}WUasadaa (sri
ui sabuuburyy
JSOW SIBAOD
vywyp fo
— aponun

sadhy
uww
buipoouy
({fo puv uo) sjvJusawmvpun4

JaVIDYD
|
smoys 0
puy hjUo

SABPIVIVY)I
syas
SHAOM AaINAWOD 944
NVM ay} 0} 4Saso]D
abunbuv)
ys buy
asodund saw1jawos — IIDSV
pivoghiax
(219q1U) 119-4 V SU puyv abunbuvy
Sasvg SA1AWIO9
U01Sae v UO Shay IV
huvuig burquasaidas fo uo Burpuaday saffia
hm hypuarssasn sow yownNrsapyxaH JaQWMNn
J-V UaVyi 6-0 WOAL S205) 99/1 VU
buipod
4 nH WUOS 03 satuanbass
UyUsI
dV} INO AAOM
wwned
iSv OJ Av1}vs JsoW saiuanbadf 4134}
(Su1podua
puy anyon ponquay
yybuay uny) ITe f0 SUM, ay} SapooVy
dew pull uol}e}UaSa/d~a, e}ep jo sjeyJUaWIepUN
If you need more space to answer the following questions, please use a separate piece
of paper.

1. Convert 10111110 from binary into decimal. (1 mark)

2. Calculate 15 — 14 in hexadecimal. Give your answer in hexadecimal. (1 mark)

3. Calculate 20 — 8 in hexadecimal. Give your answer in hexadecimal. (1 mark)

4. Calculate 20 - 8 in binary. Give your answer in hexadecimal. (1 mark)

5. Convert 3F from hexadecimal into decimal. (1 mark)

6. Convert 60 from hexadecimal into binary. (1 mark) ques


prac
Exa

7 Convert 101 from binary into hexadecimal. (1 mark)

8. The ASCII character set uses 7 bits to encode every character.


Why is there a different code for uppercase and lowercase letters? (3 marks)

How would this be coded in 1-bit colour? (3 marks)

10. How many possible colours may be coded with 4 bits per pixel? (1 mark)

a
11. Explain how sound is encoded so that#t can be transferred from natural
analogue to digital files. (5 marks)

repr
of
Fun
data
ists = lial Ae ‘
NtAe RR we csFRRLo a, B#91010104010101010
Hardware and software
In essence, a computer is the product of hardware and software. It is no use having
the newest and fastest computer if it has no programs, and the best software in the world
cannot operate without hardware of some sort.

Hardware refers to the parts of the computer that can be touched or seen: they are the physical
components — they’re ‘hard’. Software is the coding, from the machine code to the top level
language, which makes the computer perform the operations required.

Hardware Software

Grats, Ti ius

Boolean logic and truth


tables
You ought to remember the word ‘Boolean’
from Internet searches, but it originally The truth table for an AND gate looks like
refers to the construction of ‘logic gates’ in this, and you can see that it only turns ‘on’
computer science. We use truth tables to when both of the inputs are also ‘on’.
show how each gate works.

There are only three gates that you need to


know well:
1. AND gates
2. NOT gates
3. OR gates
NOT gates
AND gates A NOT gate has a single input and the
An AND gate requires the two inputs tobe | output of the circuit will be the opposite of
‘1’ or ‘on’ before it will operate. In human } the input.
terms, that could be ‘weekday’ AND na
‘school day’ = ‘wear uniform’, or alight will — | k E O
only turn on if two switches are pressed. +

A The truth table for a NOT gate looks like this:

software
Hardware,
and
Witere(ti
logic
Boolean
t-te
ert iM Hardware, software and Boolean logic
yo. %
er aewd
A %A eaie ve we 1. exer oad

Combining logic gates


The last gate you need to learn is an OR gate,
: Logic gates can be combined.
and the meaning of this one is clear from its oe
name: an OR gate operates when either of the i An AND gate followed by a NOT gate would
inputs is ‘1’ or ‘on’, | look like this:

A m UA
f K “ Q
B im 8 .
The truth table for an OR gate looks like this: yo :
i = To work this out you would need to follow the bot:
data, so start with the AND gate: -
9

The examples shown in all cases have two ies :


inputs — but the rules still work with three or aoe
more. An AND gate requires them all to be ‘1’ ig
or ‘on’, a NOT looks for inputs that show ‘0’ or find Q:
‘off’ and an OR will take the ‘1’ or ‘on’ signal
from any of the inputs. b
I QE. EERE RE
Hardware » A computer, a phone, a mewemase
tablet. Hardware is literally hard. You
can touch it
Software » Programs, apps, or BIOS. This can also be written in text form as
Software is the coding that makes the Q = NOT (A AND B) because Q is the NOT
computer do something output from the AND of A and B.

Design an interactive poster with 1. If a gate has two inputs and operates when either input
pockets that you can fill with is on, which type of gate is it?
counters to show each of the gates 2._If a gate has four inputs and only operates when all
in action. ~ four are on, which type of gate is it?

Rs \ —— _
“a | ‘ 2 ,
WS ee
Hardware, software and Boolean logic Bu Cy(. psu 53 |§
: a i)pe if =
) ri Y
ES
~ "2 > ' ' of
Classification
There are two main types of software that you need to be able to
distinguish:
1. System software, including operating systems and utility
programs
2. Application software

System software
System software is the software that operates the computer
hardware itself — not anything that you interact with, except
possibly to log in, or respond to messages. Within this definition
are operating systems, device drivers, virus protection HARDWARE
programs and computer maintenance programs such as disk
defragmenters.

Without system software, computers of all types simply wouldn't


operate at all. All other software runs through the system software.

seo

=* including
purposes
receive

management 2
12 ¢ 5
outside aos
‘ = sS O° ¢=
&3

9 ace > 30 3
$2 8%5 SQM”
= foot = (also
ad t il § ssoldest
sCetAallS? yg

5 =e panesheld common ypass

a ( einer conmputerks
x
®

e
Software
classification
Nay tose SS
= 32 ° oO eC.
ae
cma
te
oe
° T} easier
my 2 a
o® Za: Q.
Aa a
iQo Cy ains
= 4
®
yc s 33

3‘applicaations
G

dishwashers
ing contention

3
20:
)

awe

uoTeS
number aao 5s¢
commands— ~ of
runs© compact & =
Lidementia @

sa| Module 21 ‘Software daisinesiin


¢ solid 4
;4 a

Operating systems
Operating systems (OS) are key to the function of any computer.
» The OS controls the operation of the processor and memory, by managing the resources so that
each application is allocated enough processor time and power, memory and hard drive space to
complete its job. In this, the OS is like a referee, making sure everyone plays a fair game.
» The OS controls any peripherals, like printers, scanners, barcode readers that are attached to the
computer. It will use specialised drivers to ensure that the right instructions are passed in a way
that the device can operate.
» The OS controls security — logins and sometimes basic firewalls and anti-virus facilities are run
through the OS.
» The OS provides a foundation for all application software to run, allowing software developers to
write for an operating system rather than for a computer design, as was the case in the early years
of computer development. This is because each OS has a standardised API (application program
interface).

There are many different types of OS — Android, Windows X and Mac OSX are probably familiar to
you, but there are others such as UNIX and different types of LINUX like Debian and Mint. Some are
proprietary, which usually means you pay for them, while the LINUX types are all ‘free’.
a : Se = a

Utility programs
Utility programs perform specialised tasks, rather than juggle lots of demands like the OS. Some
utility programs are included in the OS, such as disk defragmenting and file compression. Anti-virus
(AV) and firewall programs may be utility programs with which you are already familiar. Regularly
updated security software is essential for safe function online.
Rs ge
oesDSS Sans
LF
Pi
a *
Se a a aD

Application software
Application software is the software that you as the user install, and it is the software with which you
work most frequently. Word processing or presentation or spreadsheet software is application software,
as are your email client and Internet browser. Again, as with utility software, application software tends
to be installed for a specific purpose, such as managing emails or browsing the Internet.

Operating systems » Platforms on which all other 1. Why is it


programs run. They manage input to and output from the important to use
processing unit anti-virus and firewall
Utility programs » Written to complete one task, such software if you
as cleaning your operating system régistry, or testing want to spend time online? |
your RAM to ensure it is still functioning . Identify two different |
Application software » Software that the user installs operating systems and
to perform defined tasks compare their benefits and }
drawbacks.
. Identify the function of
Use colour-coded cards to identify each ‘layer’ of utility programs.
software in a system. Stack them up so you have a . What function does the P..
clear image of how they work together. operating system perform? =

Software classification By ty. Cys 55 |


Von Neumann
The traditional computer architecture we all recognise is Von Neumann
architecture, or Von Neumann concept.

Central processing unit


(CPU)
Control unit
INPUT (CU) OUTPUT
DEVICE DEVICE

Arithmetic logic unit


(ALU)

You need to remember that this really only applies to the stored-program computers, in
which an ‘instruction fetch’ and ‘data operation’ cannot occur at the same time because they
use the same bus. This is called the ‘Von Neumann bottleneck’.
Traffic along a bus in the model shown can only go one way at a time — it is a serial
connection — and therefore the performance of the computer was significantly slowed.
Modern architecture overcomes this because the same memory is used for both program
instructions and data.
/

The fetch-execute cycle is the process by which the CPU reads (fetches) instructions from
the memory cache, decodes them, and then operates — or executes — the instruction.

Components
Memory

the CPU rather than in separate places on the circuit board, where the main mer
connectors are located. |
The computer uses cache ‘memory as a form of buffer because the CPU worksesfas

instructions so the processor can access them faster than from RAM each ti
tr

Cyt
architecture
Systems
(yee A register is a small amount of storage not accessed by main memory and
to get data to the CPU. Data used most frequently can be stored in registers
fastest access time.

EE odie 2
' Processor
| The speed of a computer processor is often referred to as clock speed. This refers to the internal
clock in the CPU that keeps everything working to time, like a conductor keeps an orchestra
; synchronised. The faster the clock, the more instructions a CPU can execute per second.

Clock speeds are measured in MHz (megahertz) or GHz (gigahertz). One megahertz equals one
million cycles per second — but remember that a 2 GHz CPU is not necessarily double the speed of a
1GHz CPU because the memory, the task and the number of cores will all make a difference. Clock-
digital circuits use a clock signal to ensure all parts of the circuit remain synchronised. On a modern
processor chip, this is essential due to the high speed of processing.
Buses
Buses are pathways around the motherboard that connect the components that are attached. There
are two main types of ‘buses’ in a computer: the internal bus carries data within the motherboard, and
the external bus communicates data with peripherals and devices attached to the motherboard.
Each bus has pins or lines — there are three types:
» Control — used to send out messages to co-ordinate the activities on the motherboard
» Address — used to pass memory addresses from one component to another
» Data - transfers the data between all components.
The processor bus you may have already heard of, called the FSB or Front-Side Bus, carried data
between the CPU and the memory controller, called northbridge by IBM, in the 1990s. b .

ALU
The ALU (Arithmetic-Logic Unit) performs the mathematical and logical operations required by the code,
and then passes the result to the memory. Therefore, it does the mathematics (1 + 2 = 3) and the logic
(Is this string longer than that?).
. =.

Control unit » The component in the CPU that directs the operation of the processor. It %
controls the data movements around the processor
Stored-program » A program that holds all of its instructions in RAM rather than on another
storage device
Bus » A communication system (often through wires) within a computer that transfers data
between components, such as between the main processor and memory
Volatile » Memory that is wiped when the power is switched off
Main memory » A general term used to refer to any memory other than registers and cache,
that the CPU accesses. In most situations main memory refers to on-board or added RAM —
Clock speed » One way in which the speed of the processor is measured — in Hertz
Cores » An independent processing unit within a CPU so that the processor can run more
than one instruction at a time
Clock-digital circuits » These use a clock signal to ensure all parts of the circuit remain
synchronised oe
ALU » The Arithmetic-Logic Unit is a circuit that performs the mathematical and logical
operations within the Central Processing Unit (CPU) and Graphics Processing Unit (GPU)
c oaLies

Explain why a 1GHz CPU might not be half


as fast as a 2GHz CPU.
Describe the Von Neumann bottleneck.
. What are the main limits of the Von
Neumann model?
Secondary storage
Any storage that is outside the CPU — such as hard drives, DVD drives, USB and other solid
state storage — is referred to as secondary storage. It is large enough to store the programs
we want to run, and is non-volatile so the data remains after the power is switched off. If we
relied on RAM for all of our memory needs, we would have to install programs every time we
wanted to use them, and the programs would have to be much smaller and less powerful.

As files have increased in size, and people have wanted to store


more and more data, cloud storage has become popular. Cloud
computing Is the term for processing your data on computer
systems belonging to someone else, and accessing them through
the Internet. Storage companies use ranks of data servers in
stacks, using either large traditional magnetic hard drives or,
increasingly as Capacity expands, solid state drives. This has a
number of implications:

Access from anywhere with Internet


connection. especially if you are handling large files.

across the world can access the same files. | your files safe.
Disaster recovery is easier — assuming that | Moving from one provider to another can be
your storage provider wasn't affected by difficult.
whatever hit your system.
Costs are generally lower per mB and There can be data ownership issues if your
storage Capacity is more flexible than local provider is sold to another company — when
storage. Facebook bought Instagram, all Instagram
content transferred a ‘license to use’ that
content to Facebook — without the users’
express consent.

The other option is to store your files locally. This can be either truly local — attached to your
computer through an internal or external port — or networked. Network Attached Storage is a
term that refers to hard drives attached to a network of computers solely for the purposes of
storage. You access them usually through mapping a drive letter, like N:\ or S:\ for example,
and the array of disks is treated as if it is one large hard drive.
Advantages of local storage Disadvantages of local storage

ir
You have control of your data The capacity is limited by the

External drives are cheap and have considerable capacity |Data recovery in event of a
for the non-specialist to use to extend their data storage. | disaster is down to the user.

Computer architecture is also found in embedded systems, such as digital watches, MP3
players, MRI scanners and traffic lights. An embedded system is one in which the computer
system plays a part in a much bigger device. The computer element is often nearly invisible,

Wty
Secondary
wee
storagebut essential. Unlike non-embedded systems, embedded systems are generally designed to ;
perform a single task rather than be general purpose computers.

WiCr Cem Secondary storage


Operation
Solid SSDs use a grid of electrical cells to The only drives Very expensive
state drive quickly send and receive data. These currently available compared to other
(SSD) grids are separated into sections called that are faster forms of storage.

<S
‘pages' and these pages are where than hard drives
Limited write cycles —
the data is stored. Pages are clumped (magnetic).
these wear out much
together to form “blocks”.
Start up faster faster than anything
SSDs can only write to blank pages in since there are no else.
the blocks, and only delete pages when moving parts.
Write speeds can be
there isn't enough space left to store
Some are slow.
the data required. As a result SSDs
waterproof.
perform less and less well over time.
Ideal for portable
USB devices.
A CD/DVD/Blu-ray has a single track Portable. Require special drives
of data spiralling from the centre to the to write to them.
On some formats,
edge of the disk. These are made up of
data can be Relatively small
bumps on one side, which show up as
archived because capacity.
microscopic pits on the other. The drive
it cannot be over-
motor moves a laser and lens system Easily damaged.
written (DVD-R/
to exactly focus on the area to be read/
CD-R). Some compatibility
written. The bumps (or pits) reflect the
laser differently from the flat ‘lands’ in iSSUeS ACross drives.
Inexpensive.
between, and the electronics in the
drive interpret this to read the data.
Magnetic Hard drives contain spinning platters One of the The disks eventually
(hard disk which are accessed by a read/write cheapest methods fail.
drive-HDD) head on an arm. This can move from to store data.
Surface can become
the centre to the edge of the platter up
Fast access to damaged leading to
to 50 times per second.
data. data corruption.
Data is stored in sectors and tracks —
Direct access to Cannot easily transfer
a track is one circle around the disk,
any part of the between computers.
a sector is a section of the arc. The
drive.
operating system often organises
sectors into clusters.

Cloud computing » Rather than relying on the local processing power of a


single computer, cloud computing allows the processing of data on a network
or Internet connected remote system. This can also be extended to storage

Investigate the storage 1. If! want to store my personal data, would


capacities and prices
CD/DVD/Blu-ray disks.
of
hf you recommend that | use cloud or local
storage? Why?
How do they compare to 2. If volatile memory loses all its contents
portable USB devices for example? whenever the power is switched off, why
do we use it?

Secondary storage Bu Cl- Cpe: 59 |


wWVMIOS
uonwa day
suoipun aoufo,
pu buissao01d ~iOM
iaINAWOD V 3y1] YOO] OF aAVY 1,Usa0q
Aayndwo
aninap Puy JOssad0/d
UVMyYos + UVMPAVY = JaINAWOD UaaMyagq UOYWHNUNWWOI
4 J SMOTIY ‘aap YIv—a 0} IYf19adS
sod Sanuy aad Stes | fad
pnd oe —
aGui0is huwpuoras AAVIIIPYIAV avMifos SrnagieeanG uorssasdwon ayf ‘Sna-quy
sMaqsns W9Isns i — ysv} ajbuis fiyywsauay
CSS ‘GA ‘sanup pavy —1¥907
paads swayshis burywiadO
49019 PUY Y4I01D
wvMpivy ayy sbvuvwu —uotpun4
ZHD PUY ZHW U1 pansvaw
Yuy SMOpUIM — MiuwyaUAOdd
(WOw ‘G'a) 37194] 0A-U0N ssad01d a3ndaxa — 42404
4999193409

Computer systems
puyv
Aaqsibal

MdD

M1
dew pul BOC CEE tp

la
If you need more space to answer the following questions, please use a separate piece
of paper.
1. A modern smartphone allows the user to input data through the use of
a touch screen. State three other ways in which data can be input to
a smartphone. (3 marks)

Wi
2. Smartphones use solid state media rather than magnetic storage. Identify Co
2
two differences between these types of storage media and suggest why
smartphones use solid state storage. (3 marks)
ee
Vi
Y
3
rey
3. The output of an AND gate with three inputs (A,B,C) is ON when any one
input is ON. State whether this is true or false. (1 mark) uy
an
ded
4. What would be the output of this combination of logic gates if A is ON VW
and B is OFF? (2 marks) ie
a
A
2.
Q
B =
a)
5. Describe the Von Neumann model of computer architecture. (5 marks) as
Ra

6. What is the fetch-execute cycle? (3 marks)

cf. Why is it important for computers to have adequate capacity of RAM? (2 marks)
}

8. A lot of companies are now using ‘the cloud’ for data storage. What is
‘the cloud’ and why are companies moving their data into this form of
- storage? Nin (3 marks)

Com
sys
: NN a a re

Exam practice questions Be) Oey Gai 61 |


A network is a computer system comprising linked elements such as computers, file storage
and printers. Most networks share the attribute that users must log on, though some are
‘distributed’ so that the user has no idea of the construction of the network or of other
devices in it.

There are a variety of different types of network within that definition that you need to know:

Local Area Network (LAN): A network in Wide Area Network (WAN): A network ifs
which all connected devices are relatively in which the connected devices are too
close together, in a single building or thinly spread to make a physical
premises, like a school or office complex. connection. These tend to be connected ft :
Because the distances involved are fairly through telephone lines, undersea
short, cables can be used to establish cables and, in extreme cases, satellite
physical links between each device and links. In a multinational organisation,
the servers and resources, usually through there may be LANs within cities, and a hi I
switches. Wireless and fibre optic connections WAN linking all the LANs into one large ! ne
also suit this type of network. LANs usually web. At the most extreme, the Internet
operate within single organisations. could be seen as a WAN. Sometimes, as in the
case of the Net, elements of a WAN are owned
by different people or organisations.

es of networksIm
Personal Area Network (PAN): A network often Wired or wireless: wired networks can use
based on Bluetooth connection between devices copper ‘Cat5’ ethernet cable for short distance
such as keyboards, pointing devices, phones, connectivity (up to about 100m from device to
audio headsets and printers. These cover very switch), with fibre optic cable used for longer
short distances (up to about 10 metres) but have distances. Wireless networks remove the need
the advantage that they can move with the user. for cables but all devices on the network require
connectivity.

Advantages
Reliable connection. Not portable — you're tied to the workspace.
Wired
Usually faster than wireless connections. |Generally more expensive to set up because
network
More secure. every device needs a separate cable.
Portable. Can lose signal under less than ideal conditions.
Can easily add and remove devices. Security can be an issue if passwords and other
Wireless
settings aren't strong.
network
Can be slow — especially if the access point
(WAP) is shared between devices.

LAN > Local Area Network. A network for one organisation, usually on one site, or sites which
are geographically close

WAN » Wide Area Network. A network usually for one organisation, covering a much wider
area, often countries or continents

4
Investigate the most common wireless security 1. When designing a new network for
protocols-WEP, WPA and WPA2-and produce a school, which structure would you
a factsheet on why they are important. recommend, and why?
2. Would a travelling DJ be better off
investing in wired or wireless kit? Why?

Definitions and types of networks BC) Cpa) |63|


~~
a
Topology
There are four main types of topology (or shape) that you need to know:
25
The star topology is Most reliable design: any Uses more cable than any
probably the most single failure is local and other design.
expensive: it is also the doesn't affect the rest of the
Uses additional hardware
fastest. Each device has network (unless it’s the server
(routers/switches/hubs) which
its own connection to that fails).
adds again to the cost.
the server, which means
Simple to troubleshoot
that a lot of cabling can If the switch fails, the whole
because failures are localised.
be needed. element of the network
Adding devices doesn't affect supported by it crashes.
speed of performance until
lf the server goes down, the
server capacity is reached.
whole network collapses.
Easy to upgrade or expand
Can require more technical
elements independently.
know-how to set up.
Best used in a larger
organisation than a
household if only because of
the expense.
A bus network has a Simple and cheapest to install. If the bus (spine) fails, the
central spine of network whole network crashes.
Good for a temporary network.
cabling, called a bus
Performance is affected by load
os
mn
(remember this from Flexible because elements can
— the more devices attached,
the Von Neumann be removed or added without
the slower it functions.
architecture?), which messing with the rest of the

=
transports the signals. network. Bus cables are limited in

°2.
length and must be terminated
Best used in small or
properly to avoid reflection of
temporary networks — can
signal, which can crash the
be a useful home network

©
system.
solution.
Data has to ‘queue’ sometimes
because the bus is busy with

x
ted other demands.
A ring network has Data can be transmitted Expensive to cable.

©
all of the computers from different devices
High levels of redundancy
connected to each other simultaneously, making
question the cost effectiveness
ina circle. communication more reliable

=
in this model.
and faster.
Setup and maintenance is

@
This can handle high levels of
gai traffic because each device
difficult.
shares the load. Administration of all nodes can

= Expansion is easy without


unsettling anything already
be complex.

installed.
Ideal for wireless connections.

Ly A mesh network
interconnects each
Fast data flow when it is
working well — all data flows in
Each packet of data has
to travel through all of the
N device with all of the one direction. devices between its origin and

a
others, sharing the load its destination.
Even when the load is the
for data communication,
same, this performs better If one device malfunctions
and generally producing
=
s6
than a bus setup. the whole network is
a much more reliable
compromised.
function. Each device can access the
resources on the network Setting this up is more
equally. expensive than a bus network.

fe CLI et Network topology


Network security
Any network requires security settings. Stories on the news almost every week highlight what happens
when security is breached and data released or destroyed. When you run a network holding the data
for the organisation or personal data of clients and employees, the responsibility to maintain security
is considerable. If your network is holding personal data, your responsibility is also identified in
legislation like the Data Protection Act. The Information Commissioner is responsible for investigating
breaches of data security where there is a question of negligence.
The main methods of network security that you need to know are:
Authentication: Checking the identity of a user, often by checking their user name exists, and that
their password matches. Obviously this is vulnerable to hacking, and passwords should be changed
regularly and frequently, meeting high standards of robustness.

Encryption: Makes data appear meaningless and provides security for the content both when stored
electronically and when transmitted using an encryption key. Decryption uses the decryption key to
convert the data back to an intelligible form.

Firewall: A software or hardware product used in a network to prevent external


users gaining unauthorised access to a computer system. Firewalls limit
_ the data and instructions that are transferred to a server, sometimes by
blocking a specific port on the computers, sometimes by requiring that the
transmitting device be on a whitelist of authorised devices. The port is the
visible connection to channels on the motherboard that transfer data.

MAC address filtering: Using a MAC address, a whitelist of authorised devices can be maintained
and any unknown devices questioned or blocked.

Whitelist: Identifies authorised sites if on an Internet filter, or users or machines if on a firewall. Only
those on the whitelist are allowed through.

Blacklist: Bars only those devices or addresses identified on the blacklist.

Most networks will run all of these systems to help ensure that only authorised users and devices
access network resources.

Port » Identifies where a channel enters or = Use match boxes


leaves a computer system: this is a physical and string to create
location where components can be plugged into models of the different
the device. Ports are often given port numbers to topologies.
enable easy selection and identification rv.
Whitelist » Identifies authorised sites if on
an Internet filter, or users or machines'if on a 7 . Asmall company
firewall. Only those on the whitelist are allowed / in one building has
through. This is more secure than the blacklist ad five computers: they
because that simply bars only those identified on want to network them
KEYWORDS
the list: the whitelist bars everything except what but have very little money. Which
is on the list ¢ type of topology would you
MAC address » Shortfor Media Access recommend and why?
Control address, a MAC address is inbuilt in . There are two controls —
the hardware for any device that may need to whitelist and blacklist. Which is
connect to a network the stronger setup and why?

Network topology BCL Cee 65


Devices on any network from a home to the Internet must follow protocols if they are to
communicate and function effectively on that network. The ones you must know are:

| Ethernet This protocol comprises a number of components. and standards. It is made up of


| the frames in which the data is sent around the network; the physical layer, which is
the actual transmission of the signal including the clock signal to ensure the sending
| and receiving clocks are in sync, and the MAC address, which identifies the sending
device. To send data, the device first listens to check whether the connection is free.
| If itisbusy itwaits for a set delay and checks again until it can send tthe data.
This is in reality a range of different protocols rather than one.
Wi-Fi is a trademark. The correct term for wireless networks —,
| is WLAN and they are identified by the number 802.11 with a aie,
| letter following it to identify its generation. The fastest currently &
|is 802.11ac, which has a maximum data rate of 1.3 Gbps.
|This stands for Transmission Control Protocol, and is a standard that defines how
|to establish and maintain a link through with programs can transmit and receive
| data. You might have come across it in connection with TCP/IP. TCP controls how
| each message is broken into packets that the network can transport, checks that all
| the packets have reached their destination (and re-sends those that are lost), and
receives packets in turn from the network layer. All communication is sent in packets
| to balance the load, whether that be in a two-device home network or the Internet.
|Packets have headers, which are like envelopes showing the destination address.
Internet Protocol is the main communications protocol. This works with TCP to address
data packets accurately and decides the best route to use to send the data. Some
|data packets will take different routes to reach the same destination if the network is
| particularly busy and it is quicker to send some data ‘around’ the bottleneck.
| HTTP(s) |This stands for Hypertext Transfer Protocol, and the additional ‘s’ is the more secure
| method of transmission. This runs on a client-server architecture, and examples of a
| server include Apache Web Server and Internet Information Server (IIS). The client is
k also called a Web browser, and examples include Firefox, Chrome, Edge and Safari.
Simple Mail Transfer Protocol also operates on the client-server model. The sending
| email program contacts the mail server of the destination to indicate that a message
| is coming, and waits for a ‘ready’ message in return. The message is then sent in
| stages, with the receiving server confirming each one, rather like you repeating a
| message that someone tells you in a telephone conversation.
| Internet Message Access Protocol differs from SMTP in that when you use IMAP
you leave a copy of the message on the email server, rather than downloading it to
| your device. This has the advantage that you can access your email messages from
|
| anywhere with a signal, but it does make management and security of messages
|more complex.
| File Transfer Protocol uses the client-server architecture to connect devices, often
using a login and password to confirm secure transmission. FTP is less common
| now as a separate technology, though it is incorporated into many web page editing
| software packages._
| User Datagram Protocol isn'tas reliableass TCP but is much ‘simpler and is useful for a |
}| less specific broadcast type of task rather than communication to a specific recipient.
| Itdoesn’t check for errors in broadcast, or resend lost data packets, so it is faster
|than TCP.
| Post Office Protocol 3is
‘isused to log into and retrieve messages from an email server
| and download it to your computer or device. Most email clients using this protocol
| periodically check for new messages and once downloaded, messages are normally
| deleted from the server.

3 Communication protocols
TCP/IP |
ah hah See
rw!

This is such a significant part of the operation of the Internet nttp |


NN
that you need to know more about this separately from the other
protocols. The TCP/IP model of the Internet looks like this:

The topmost layer includes protocols like DNS,


APPLICATION LAYER HTTP(s), SMTP, IMAP, SSH, FTP. This controls how
applications access data and communicate.

The Transport Layer sits beneath the application layer and


TRANSPORT LAYER permits devices on at each end of a connection to have a
conversation. This operates TCP and UDP.

The Internet Layer is second from bottom. It packs data into packets
INTERNET LAYER | that include the source and destination addresses and the order in
: ; which the higher layers should reassemble the packets on arrival.
SL SE a ea |

S| NETWORK ACCESS The Network Access Layer defines how data is physically sent through
the network, controlling the hardware along the route. Protocols in operation
(or DATA LINK) LAYER here include IP and Ethernet. You can see evidence of the layer when you
view the NIC (Network Interface Card) in your computer.

In the Application Layer you will find the programs, or


applications, such as email and web browsers. They are at the top Make a model of
because they do not hold the details of connectivity — like drivers | the TCP/IP layer
don't control how the roads are constructed or the traffic lights.
and add sticky
The Transport Layer sets up the communication between | notes to show
the sender and the destination, making sure they agree the fy which protocols operate
‘language’ and also that the recipient knows the size and | where: use colour codes.
number of packets that it should expect. If any go astray the : Then ask a friend to remove
Transport Layer automatically tries a number of times to re-send one and see if you can work
before transmitting a ‘failed’ message to the original sender so out which is missing.
that they know the message went astray. | i
What does
Protocols » Protocols are a set of communication FTP stand for?
standards that govern transfer of data between devices True or false —
Packets » Information broken down into single unit The Internet
of data, or packet containing the source, data and Protocol (IP) is the
destination, that is sent between computers or devices foundation layer of .
on a network the Internet. .
Network layer » The part of the Internet that is What is the difference
responsible for packet forwarding through routers from between IMAP and SMTP?
sender to destination, also Known as data link layer
Client-server » This model spreads the workload
between the main server and the user's device: a client device may share resources with
the more powerful server, which enables faster communication because the server does the
work before transmission
DNS » Domain Name System is a naming service, allocating unique IP addresses for all
connected devices on the Internet, or a local network. It also links your familiar website
domain, or web address, to the numerical IP address of its hosting server
SSH » Secure Shell allows encrypted access to networks over the unsecured Internet

a _
a F ; p ae.) an
oh
: 5
Communi cols Module 26 |67|
_-_ ’ ‘
n 7 Lan
‘ *
hen. ”
lf you need more space to answer the following questions, please use a separate piece
of paper.

1. A friend is setting up their home network and Internet access with two
computers, three tablets and their phone. Would you recommend that
they use wired or wireless? Give two reasons in your answer. (3 marks)

2. When would bus topology be a useful structure for network design? (2 marks)

3. How does encryption aid security on a network? (2 marks)

4. What is the difference between a whitelist and a blacklist?


Explain which is the more secure. (4 marks)

ques
prac
Exa
5. What is the client-server model? (2 marks)

A]
6. What type of network is the Internet? (1 mark)
a,name
eS)
Identify each of the layers of the TCP/IP model of the Internet. (4 marks)
=
Y
da

=
d
ed

=
wx?

2.
=
°Ww
2)
Gis

one
&
e
ad

7
(1 mark)

S
&
"oO

=
3
bbe

Exam practice questions Fundamentals of computer networks |69|


cys

Py a ae
_ Definition and purpose
Cyber security refers to the range of strategies we use to protect computers, programs and
data from malicious attack or damage.

There are an increasing number of styles and types of attack, and it is worth reading technology
we and business news headlines to be aware of up to date information.
-: -

5 Types of threat
>) The main cyber security threats that you need to Know about are:

Description
Malicious code Any element of code in a software system
that is designed to breach security or damage
the system, including viruses, worms, logic
bombs, Trojan horses (backdoor and
trapdoor) and other malware. Spyware is the
generic term for programs like keyloggers that
hunt out and transmit to a third party details
held on computer systems.

Your best defence here is common sense and caution, supported by up-to-
date anti-virus and firewall provision.
Poor password practice Many hackers rely on users failing to recognise the important of strong
passwords and exploiting the following examples of poor practice:
Leaving any device, website or software password at its default
admin setting.
Using the same password for many services: a social network and bank
account for example.
Using one of the many commonly-held passwords: p@55wOrd, for example.

and
threat
purpose Poor access rights
configuration/Network
Keeping track of who can access what is essential for any computer system,
including deleting the user privileges of those who leave the organisation. A
policy weaknesses good network policy includes the ways in which this can be done — allowing
no other, so that standardised approaches are used across the organisation.
It also specifies the computer systems themselves, so that software and
hardware are all to the same minimum specification, and sets up a regular
audit of all procedures, to ensure the rules are being followed.
Unpatched and/or outdated Browser and operating system, driver and application software, are regularly
software updated to ensure robustness and security — and malware writers are
inNMION, constantly benefitting from those who delay their updating.
Removable media The growing availability and capacity of removable media
such as USB storage devices and Bluetooth connected
devices means that your computer can be infected without
ever connecting to the Internet.

Malware, viruses or other executable programs can be


transferred to a device disguised as a user-friendly file
and then run accidentally at any time.
Brute force attack A brute force attack goes through every possible combination of passwords.
This could take days or more depending on the strength of the encryption, the
strength of the password and any other protective measures taken.
Distributed denial of service This is when a site is attacked by a number of systems, causing the server
(DDOS) to shut down access to legitimate users or even to entirely shut down. The
attacker compromises one computer and takes over its access to the Internet,
then uses it to infect others with malware that allows them to be controlled.
A computer under such control is known as a ‘zombie’ or ‘bot’, and botnets
(collections of these hijacked computers) are considered one of the biggest
current threats to Internet security.

#73);
Module
27

70 Bty- (bya Definition, purpose and threat


SQL injection This involves targeting database-based websites, such as an online retailer, and inserting
malicious SQL statements into the website database server that has a weakness or
vulnerability. Attackers may then be able to spoof their identity, edit financial or personal
information or simply delete important data.
Ransomware Ransomware is a type of malware that infects a computer system in some way and the
user is asked to pay a fee, or ransom, to remove the malware and free their system.
Social engineering Social engineering attempts to trick a user into revealing security information through
techniques ruses such as pretending to be a new employee, or a colleague from another branch,
or someone begging you for help. Asking them to contact you back on an organisation
phone extension can be one method of defence, since email addresses can easily be
faked. Types of social engineering include:
¥» Blagging: creating and using a fake story to fool a victim to reveal secure information
that they would otherwise keep secret.
» Phishing: fraudulently obtaining information by claiming to be a reputable
organisation, such as pretending to be a bank requesting login details. This is often
done using email or text message. Sometimes referred to as ‘smishing’.
» Pharming: an attack against a website, directing legitimate traffic to a fake site. This
is why it is best to use your own bookmarks/favourites rather than rely on a typea-in
web address.
Attacks are not only virtual — ‘shouldering’ is when you watch someone type in their PIN
at a cash machine (ATM) or in a store and then snatch their card.
Adware This is justified as a way of paying for software for which the user might not want to pay
in money. Advertisements are included in the software program and are displayed at
intervals during use.

Virus » A program which has been written to replicate itself on the host computer and
across to other unprotected computers where it has access
Worm » A program that spreads itself through network connections to other systems
Trojan horse » A program that appears to be benign but is actually causing damage that
the user often cannot see until it is too late
Backdoor Trojan » Also known as Trapdoor Trojan, is a program left by a hacker allowing
free unauthorised access to otherwise secured elements of a computer system
Malware » Generic term for software that users may unwittingly download onto their
computers, ranging from viruses to keyloggers and spyware
Spyware » Spyware is the generic term for programs like keyloggers that hunt out and
transmit to a third party details held on computer systems
Keylogger » Records all typing on the keyboard, and transmit this to its owner. This can
clearly include passwords and other identity information

How can a program stored on a USB storage device be considered a threat to a


computer system? s
Does a computer system not attached to the Internet need a firewall? Why?
How does a phishing email try to gain information from you?

Definition, purpose and threat Bu Cl: (py,


—_
ee eo
“pinesyep eee aS
g eure

Defence against cyber security threats


The weakest link in any computer system is the user, and a number of 28
strategies have been developed to try to strengthen this element.
The main cyber security defence elements that you need to know about are:

Best suitedto|Strengths [Weaknesses


Biometric Mobile High level of accuracy. Some people find it
measures devices, Most cost-effective form of biometrics| uncomfortable since
(fingerprints, |especially currently available is fingerprint, it is linked to criminal
eye scans, fingerprint which is also the most common. identification.
hand or palm |Other Eye and facial scans are loved in Can make mistakes.
geometry, devices with |movies but this is expensive tech. Not ideal for children
typing peripherals for since, for example,
Signature, voice and typing
patterns, biometrics their fingerprints are still
recognition look for similarity
facial growing.
to stored patterns rather than
recognition)
understanding the phrase, ‘open
sesame!’
Easy to use.
Non-intrusive.
Small storage requirements on the
system for fingerprint.
Password Any device Cheapest security system of all. People forget them!
systems If frequently changed, passwords Vulnerable to brute force
can be among the most secure attacks and keyloggers.
access devices. Depend on users using a
No specialist hardware required. secure combination — and| .
only once for each login.
CAPTCHA (or Online Distinguishes between human Can be difficult to read —
a simple tick resources access attempt and machine brute especially for people with
box stating force attempt. visual impairments.
‘Lam nota Limits spamming and bot attacks. Some browsers don't
robot’) render them accurately.
Audio version offered.
Audio version isn't
Hard-to-impossible for optical
character recognition to read. always clear enough to
understand.
Requires a keyboard so
not entirely user friendly.
If password is encrypted, then the Can be delayed or caught
only information passed is a link by spam/junk mail filters.
to reset the original password, so If password not
resources stay secure. encrypted, and that is
Depends on accurate setup and sent by open email there
correct email address typed in. is Clear risk of abuse.
If you mistype your email

1VCore
(t
Detecting
and
threats
preventing
(-t:3 address the message
goes astray.
~—

72 Buty (et:
El
3
Detecting and preventing threats
wr
Automatic Local installation Avoids the ‘user problem’ Some feel this is an invasion
software of online copies altogether. of privacy.
updates — drivers, Keeps software up to date selecting Requires that the computer
operating the right elements each time. system is operating at pre-
systems, arranged times.
application
Can slow Internet access
programs
speeds.

Others include:

Access levels
An option often overlooked, this can limit the opportunity for someone to wittingly or unwittingly cause
damage across a network. Network users are assigned a level of control over resources on the
network that match their role and no more. In a school, only the network manager and possibly the
head teacher will have ‘total’ control: others will have progressively less control since they don’t need
it. On the odd occasion when someone needs a task completed they would need to ask someone
who has the level of access necessary. This adds a level of checking as well as a trail of action.

Firewall
A firewall is a system — hardware- or software-based — which scrutinises network traffic and applies
a set of rules to limit the possibility of illegitimate traffic passing through. This is a barrier between
‘trusted’ devices on the same network and less trusted devices or networks — such as the Internet.
Some organisations take this further by including a proxy server, which is an additional intermediary
between the trusted and the not-trusted devices.

Anti-virus software
This now often includes protection against a range of malware, and adds a layer of
protection against malicious software. The simplest kinds rely on scans to check
Antivirus
through your hard drive, while others are constantly actively scanning for changes
in your data that could be caused by malicious software. It must be said that all
AV/firewall software is only as good as the operator, and nothing can override your
' choosing ‘yes’ to install something nasty.

- Encryption
4This iis the conversion of an original message (plaintext) into a code (ciphertext) using a key. Encryption is
now essential to much communication over the Internet: secure e-commerce, banking and other personal ,
‘ data transmission would be impossible without cryptography. As with passwords, it is accepted that ne is
nO ‘unbreakable’ code — just ones that take too long to be worth the effort.

é
Biometrics » Physical attributes unique to
each individual

1. What would be the best form of


biometric security for a computer
Draw around the hands of a few friends system? Why?
to see how finger length and spacing 2. Why are software updates sometimes
biometric dimensions can differ between valued by software companies but
individuals. not popular with users?

Detecting and preventing threats By (v.11) (2:


™% Neva

Wider impact of digital HeeHnolege


In the exam you will be expected to have thought about more than just the 29
separate subject areas: you will need to have a supported (by evidence)
opinion on issues such as the ones on these pages. There are questions here
to help you think about your answers.

Ethics

Is anonymity a ‘good’ The EU ‘right to be forgotten’ rules are said to be helping people putAgptentee
thing? What about the was incorrect— but is it also helping criminals? Whose rights should Be
ho aaa
‘trolls’ on social media? .

e lf you store your files online (on someone


Access to online resources else’s computer) how is your security of data
maintained? Is cloud computing the answer
Is it fair that only those who Uneven broadband access to our local problems, or does it provide
can pay for access in the based on geography - problems of its own?
first place are able to gain simply where you live can
the special online offers, define your mobile phone
while people too poor to pay and broadband speed and
for access must pay more? connectivity. Is this fair?

Privacy
Identity theft is agrowing business. With GPS in so many items — is it impossible to
How should this be dealt with? be ‘away from everyone’? Is this a bad thing?

Wearable tech

A piece of tech that monitors your i If someone wears or has implanted


heartrate might be valuable if you a computer system that helps them
are at risk of heart attack — but what perform better — is that cheating?
if it is hacked?

pe URS decisions
Vi : Are we slowly expecting

i
more of computers, and

=
less of ourselves?

uu
ie)

Legal copyright Hacking


ON
N If so much can be simply stolen, or at best ‘taken for
free’, does it matter that copyright isn't respected?
Should electronic files be available to be downloaded
Does it matter if systems can be hacked? How do
we protect ourselves? What should organisations
do when our data held by them is compromised?

— regardless of cost or development? How do we pay for

=
the people to do the work if we don’t buy the access to
the product?

"oO

°
=
7a Module 29 |Ethics:
..
.BP. law
You MUST know the main provisions of:
» Data Protection Act (1998)
Only applies to data about /iving people, known as
personal data.
Eight data protection principles:
Data should be fairly and lawfully processed
Data should only be used or disclosed for the
specified notified purposes
Data should be adequate, relevant and not
excessive
Data should be accurate and kept up to date
Data should not be kept any longer than necessary
Access must be provided for individuals to check
and correct their data, with a right of explanation
when a computer takes automated decisions
based on the data
Data should not be transferred outside the
European Union except to countries with adequate
data protection legislation
Freedom of Information Act (2000); (Scotland
2002)
This Act allows the public a right to information
held by public authorities such as central and local i!

government, the NHS, education and the police. All


Copyright » Refers to the right
requests must be handled within 20 working days, of the creator of a product to
giving reasons if they refuse the request. There are control how it is used
over 20 codified reasons for rejection of requests. Personal data » Data held
Computer Misuse Act (1990) by organisations about living
This is aimed specifically at the offence of hacking people
and computer misuse. The Act relates to hardware
and software, making it a crime not only to access
a system without authorisation, but also to edit or
access data on that system.
Copyright, Designs & Patents Act (1988)
This gives the creators of musical, literary, a Why is it important to consider
dramatic and artistic work the right to contro! how the ethics of things we do using
their product is used for a set period. Naines often computers and the Internet?
aren't considered copyright, but otherwise if the Would using a computer controlled
product is believed to be original, and showing company toaster for an illicit bagel
the result of skill and effort, the work can be against company rules break the
copyrighted. Products like vacuum cleaners are Computer Misuse Act?
often patented so that any element of the design Does a 14-year-old have the right to
used by another company wiinout permission can request a copy of their data under
result in a law suit. the Data Protection Act?
4 ; ae bial Pa |)
Pea Se ee
fe ft} ee a

Introduction to encryption
This has already been mentioned in a number of chapters so here is where
all of the information is pulled together. 30
Encryption is the process of converting plaintext (original, unencrypted) into ciphertext
(encrypted) so that the message is as close to impossible to work out as makes no
difference. It is accepted that no cipher is unbreakable — but if the cipher key is only used for
a set number of hours, and it will take longer than that to break it, then it is secure enough.

Encryption isn’t encoding — if you encode something you are changing it into another format,
such as Male = M, Female = F: hardly a top secret action. ASCI| encodes the letters you type
into numbers that the computer can process. So encoding helps the transfer of data.

Encryption is designed to focus the transfer of data to only those who have the key. Anyone
else just sees a garbled transmission, such as ‘95’ and doesn't know what this means.

Hashing is used to check whether anyone has tried to break the code before sending it on.
Any changes to anything in the content will produce a garbled or changed message when
the legitimate key is used.

A simple cipher
One of the simplest encryption systems is known as the Caesar cipher — used by Julius
Caesar to communicate with his armies. This is a simple ‘shift’ cipher, whereby each letter
represents another in a logical sequence.

It's easier to see it like this:

A\B/C/D/E|F/G/H/1|J/K/L/M|N|O/P/Q/R/S/T|U|V
|W X|Y¥ |Z)
/

wix|y¥|z/a[Bic|Dje|F/G/H]
1|J|KiL|M/N/O/P QiRis|T/UlV
The top row are the letters we will use for our plaintext message: the bottom row still contains
the same letters, but they have been ‘shifted’ five places to the right. Using this simple cipher,
the word ‘computing’ becomes:

C|O|M/P/U|T|IIN|G|
LYIKI I {L/Q/PlE}y|C|
Clearly this is fairly easy to break, and you can make it more complex by changing the letters
in the encryption to numbers:

[C}O]M|P UIT] 1INIG


25)11) 9 |12]17)16)
5|10) 3
And then totalling them up — which is the meaning of the 95 at the beginning of this section.

For the exam, knowing how to use a simple cipher is enough — you don’t need to be able to
translate the more complex work.

In addition to the moral and ethical need to maintain security of data, you will remember that —_
Encryption
WUCyretiCeeliae the Data Protection Act requires all organisations to take reasonable measures to prevent
loss of data.
Uses of encryption
Organisations will usually have data protection policies S
which will include encryption: schools will usually encrypt i
Plaintert Dp Encrypted 74) Plainterxt
data held on portable devices that staff use, emails that —> [ Text g eo Ts

S00 oe
identify students personally, for example. Encryption ——-_—Decrypttow
Sender Recipient
The most familiar method of encryption for most users will
be SSL — Secure Sockets Layer, a protocol that uses a publioKey pritatn Key
key to encrypt data across the Internet using two keys:
A public key accessible to all

:
2. A private key known only to the recipient of the message.
This combination is the only way in which secure communication is possible: pick a global brand like

.
Amazon— how could they have secret keys with every one of their customers?

c
<5 SD ORR AEE 2923a ere oe ead WEES S: Das. gon od 5
ag PSE Se
Reka a j) Poca ee 7 4
a aae tS a a a Te ror hi asa Rey> ake : ae

Huy SSL ee
Your browser connects to the website and requests an identity check from the server, to make sure
that the server sends a recognised SSL certificate. If this is part of a list the browser holds, then all is
DE
FORRES?

vere mer
well. If not, the browser will ask the user ‘Are you sure you want to deal with these folks? | don't know

5
them!’ At this point it is a good idea to pause and check you have typed the correct URL, because
this is a hint that something isn’t necessarily right. If the certificate is recognised, the URL changes
from HTTP to HTTPS and you can continue your session in an encrypted mode.
a Te RET ae “Dor ogre
Se 2s eee ac;
saree sae

Plaintext >» Unencrypted message


Ciphertext » Encoded or encrypted message that
an unauthorised person cannot read
Hashing » Validates the content by detecting any
modification since hes . Use asimple five shift right
+e Caesar cipher to encrypt the
word EXAMINATION. What is
Make a simple Caesar cipher using two rulers, § the result?
each with the alphabet on them, shifting oneto § _ What is the difference between
change the code. k encoding and encryption?
GD GU yVYV sv 1]aM sv
buiysay

auasay sof hbaywsys v aq UVD


uo1qwsaVad
burysiud buruaauibua wvuyos awpdn nywwo ny
11905 auafep
4aqnod UOnVWUUYfuod UWA
sa1b9qVvs4s
sayaqv A vawsafed auafed VHDLdVD 100GaA/VWHILdWD
uo bora 3010 40 Budhy
awvMyfos
pawp mo hayawmioab wyvd 10 YUYH
SUOISIAA PIO /payrywdun MME TIS EES


syuqaW01g suvos vuijal/any
ynvfop ww Yq
UOWMWOI 1SOW SJUUAAabU14
ayqupipasd

swiayshis ssosnv payvaday


saryimqisuodsas puy yy bry
ES

anqovsd
piomssvd
400d
REE.
Sd1Y4}2 puv
hyundsas saqnd soya
myuanbasf pabuvy) ON
3
wow Buryjou — papaau
sybu ayy hyo bu1q4a$ =
| sMaiA ANON $301 VI U0) DUIP1Ad 1V
:i away Viayy vayM Main fo Sonat we bib besti
'‘ ae ———
Meet
—4 "
vajajap jou ayfoud uasn ‘byfuoo yy bu 10d INO, “eMatn anon suoddns aUapina WwYM
= cai Ssa00V 400d Wwalyt
papaau ; UayMJOU eae fo
sadn éxUIYI NON op wYyM
' \\ u1b0] WiMipy asr)
mae
UM

py sJualvd BU hisag ‘ybuhdod


wo

+4 BET sosioy uvloil


sway py uowuosu| fo wopadi4
4aqnd
aaaial

Cyber security and ethics


DV asvisiN Jandwoy
ee
al)

SWAAOM ae apoo
ee Sno1nvyW pV U01}90} Old VIVA

e
uoinuryed AVI SSAUIAU
Y100}0V11g
wpa shui fo
ph bettas ssa00v JOUsaqU |
( sonaap gsn
\\\
pasuoynvun
Ye yovyy words vywyp yay a1qusvaM eee fe
Wods vIvp puv puy swuia}shis 39940/d

ae
one
swiayshis 3991 0dd
dew pull

y4
If you need more space to answer the following questions, please use a separate piece
of paper.

1. Identify the difference between malware and adware. (1 mark)

2. A teacher is using photocopies of a book for a presentation in assembly,


and has forgotten to identify the source of the copies. What law is being
broken? (1 mark)

3. What is the difference between ‘blagging’ and ‘phishing’? (2 marks)

4. \f aschool chooses to back up its data to the United States of America,


is it breaking the Data Protection Act? Explain your answer. (2 marks)

5. Identify a limitation of CAPTCHA. (1 mark)

6. What security option would you recommend for a teacher's laptop to


protect the data on it from theft? Explain your answer, comparing at least
que
prac
Exa
two systems. (5 marks)

a)
=

om
Vv
Oo
(3 marks)
How do updates help you protect your computer against security threats? i
re
ot
ued
.=
8. Consider three technical reasons why social networking sites may have =
been used by large groups of people Around the world to organise protests. (6 marks)
i
Vv
Wi
hea
7)
>.
ee

Exam practice questions B97 eon uits


> Y) © a] So D
Character Decimal Binary Character Decimal Binary
number number number
blank space 32 94
33 95
34
35 97
36
65
1 OO

67 101
102
103
ri0 104
1
is 1 OS
1
if2 06
73 107
74 108
75 109
‘ic = 110
77 ase
78 ie
ih9 113
114
81 115
82 116
83 TW,
84 118
8 5) 118
120
87 121
88 122

Me ASCII Table
Fundamentals of Algorithms 1. Removing non-essential detail allows focus on the core
Quick test questions problem. (1)
Pages 4-5 2. Aplan could go down the wrong path, solving the wrong
1. An algorithm is a set of steps, or instructions, to complete a problem. (1)
task, such as a recipe or a washing machine program. 3. Identifying common elements that can be combined to
2. An efficient algorithm only uses the resources it absolutely help design a simpler solution. (1)
needs to complete the task — no more, no less. It prints the numbers 1-10. (2)
3. The main components of algorithms are INPUTS — PROCESS
¢ Effectively using the computer resources available at
— OUTPUTS.
the time.
4. When you use a trace table you go through your code as if
e Using the minimum amount of steps or code.
you are the computer, writing down the inputs, the processing
e The least possible time for the program to run.
and the outputs. This is an essential part of testing, and can
(3 marks: 1 mark for each point made)
help you see where the computer code would go wrong
The binary search approach chooses the middle value in a
before you even enter it, which saves time in class — and
sorted array (1), and works out whether the value sought is
money in business.
higher or lower — moving up or down the list (1) to locate what
Pages 6-7 it seeks. This means that the computer only ever searches
1. Binary search, because the book will be huge and it will be in half of the data, because it is either on the right number, or
a sorted order (alphabetical). Splitting the range searched is pointed at the right half of the data that is in the array. A linear
more effective. search is used when you can't sort the data into any useful
2. Start with all numbers 22, 19, 17, 15, 2, 9. Sort so that the last order (1), or when there are very few items to search. This is
two numbers are in order and check the middle number. The because it is also Known as ‘brute force’ searching (1). The
middle one is 17. computer searches from the first item until either the end of
3. Binary the data (1), or until the item sought is located, one by one.
Pages 8-9 This can take a really, really long time, which is why it is used
1. Both will produce the answer, but bubble sort may take a lot only when a binary search isn’t possible or appropriate.
longer. Merge sort is also known as ‘divide and conquer’ (1) because
2. Compare 22 and 19, OK, compare 19 and 17, OK, compare like the binary search the merge sort splits the data in half,
15 and 2, OK, compare 2 and 9, swap 9 before 2 and start sorts the smaller groups, and then merges the two together
again. When comparing 9 and 2, OK, sort complete. 22, again. Bubble sort comes from the way that stones settle in
19, 17, 15, 9, 2. The list is fully checked again before the a tank of bubbling water (1): the smaller ones ‘sink’ to the
computer declares it is sorted. bottom of the tank while the large ones appear to rise to the
3. Merge top. That is why sometimes a bubble sort is called a sinking
sort (1). Bubble sort is horrendously long-winded, which is
Exam practice questions
why it is only useful for very small volumes of data.
Page 11
if Programming 1
Quick test questions
Pages 12-13
1. A digital data = on/off, true/false
2. Any WHOLE number.
3. Iteration is repetition of a process or sequence of instructions.
This will help a programmer because, for example, they can
write the code to check for the temperature value once and
set the computer up to test for a set value continually.
Pages 14-15
1. Organise everything together
Plug in a kettle
Put teabag in cup
Put water into kettle
Switch on kettle
Wait for kettle to boil
Add water to cup
(8 marks: 1 mark per correct answer) Remove teabag with spoon
Answers such as: Add milk and/or sugar
establish size of vehicle. , Serve
e Set spray for soap. 2. Pseudocode is closest to natural English of all the languages
e Set brush height based on sensor settings. used in Computer Science. We use it to structure our
e Set water jet bar height based on sensor settings. planning before writing the code for real. It is not written in
¢ Set fan bar height based on sensor settings. full sentences, like natural English, but in code structure.
(5 marks: 1 mark for each point made) Computers do not understand pseudocode.
Answers such as: 3. FOR is count controlled, WHILE is context controlled. FOR is
¢ Clear out all hiding places (e.g. under bed) and place set to the limits designed by the programmer, FOR temp>20;
items in their correct storage locations, but WHILE depends on the conditions.
¢ Clear out all horizontal spaces (including bottom of wardrobe)
and place items in their correct storage locations.
e Return all iterns not belonging in the room to their rightful locations.
¢ Dust and vacuum. (2 marks for four points made)
Decomposition helps programmers because once a task
has been decomposed it can be tackled one element at a
time (1), and the code can be produced one module at a
time (1), so they can test each section more effectively (1).

Answers 8
Pages 16-17 Exam practice questions
1. 11/2 Mod operation = 1 Page 21
11/2 Div operation = 5 1. (a) Counter is an integer. (1)
2. 84+2=7,92/3 =4 (b) (i) Variable is a storage location in memory which
7*4=28 can hold data and is given a unique name by
3. IF temp =hot the programmer. In the code above, counter is a
Cold drink variable. (1)
ELSE (ii) Iteration is the repeated operation of a sequence
Hot drink of statements in a code. In this example the code
iterates 11 times and on the final time, when the
Pages 18-19
counter value equals 11, it falls to the ‘all done’
if
START output. (1)
(iii) An algorithm is a sequence of instructions to
Y complete a task in a set number of steps. In the code
above the algorithm counts from 1 to 10, then prints
BOIL KETTLE
‘all done’. (1)

Y Named subroutines, constants and variables are easier for


human programmers to track (1) and check effectively: the
FETCH CUPS/MUGS computer doesn't know the difference. Being quickly able to
see where a particular subroutine is located can enable faster
Y upgrades and debugging (1).
ASK ‘TEA A variable is ‘assigned’ when it is given a name and a value
by the programmer. (1)
OR
Definite iteration has a specific limit (1), such as ‘For | = 1 — 10’.
COFFEE?’
Indefinite iteration is seen with WHILE commands because the
y computer will run that section of code until something else
happens (1), so ‘WHILE temp >20, print “Warm” will print

!
the same thing for as long as the temperature is greater than
NO PUT COFFEE 20 degrees, regardless of how long that is.
IN MUG IF GameOver THEN
SCORE = PlayerSCORE
IF SCORE > TOPSCORE THEN
Yes TOPSCORE = SCORE
PRINT “Genius”
IN MUG ENDIF
PRINT “Game Over: See you next time!”
Y ENDIF
= ADD MILK/SUGAR (1 mark for variables; 1 mark for completed code that
shows the nested IF; 1 mark for clear ends to IF loops)
Within a program, using the AND function means two
conditions must be met to achieve a certain output but the
STOP
NOT function means the opposite of any condition is returned. (1)

2. Programming 2
Quick test questions
Pages 22-23
Any individual detail such as first name, surname, address,
phone number, date of birth.
2. Just the names [Fred; Alfie; Oscar]
LEAVE UMBRELLA TAKE AN 3. Using a key, value combination in a two-dimensional array:
AT HOME UMBRELLA Pets(0,0) = “Fred”, Pets(0,1) = “Dachshund”, Pets(1,0) =
“Alfie”, Pets(1,1) = “Labradoodle”,
Pets(2,0) = “Oscar”, Pets(2,1) = “Terrier”
Pages 24-25
1. Write means you want to write new data or overwrite existing
data, read means just look at it.
2. Because it takes more memory, more time to load, and allows
3.
more possibility of error through accidental edit or delete.
Pages 26-27
1. For example:
[Convert atingtointeger —[inieving)
id
ISITA
STAY INBED! |< SCHOOL —>| GO TO SCHOOL
DAY?

Convert content of string to ; -


upper case string.toUpper(fred)

Convert content of string to string.toLower(tred) > sa


a STOP i
2. If you were translating words from one language to another using Exam practice questions
a keyboard which does not have the same character set: you can Page 41
just type the number; if you were checking that a page is laid out 1. The code can be written once, then used more than once (1), as
correctly and wanted to check how many spaces had been used in needed (1). You can access and use any variable (1) from your
a line. main code without having to redefine (1) it.
~:Rug hocs 2. Structured programming is an approach that forces a logical
Pages 28-29 structure on the code (1). Clearly breaking a big task into little (1)
1. Cryptography, simulations, gaming, gambling, science ones makes the big task more achievable, using code modules
2. Without limits, an unnecessarily large or small number could be or subroutines (one for each part of the task) makes it easy to
generated see which part of the code does which part of the overall task (1),
updates are a lot easier — you just change the bit that needs to be
Pages 30-31
updated.
1. One-to-many — while she has only one Form Group, that Form
3. Any three from the following: source code is more easily
Group will have more than one student.
understood when the elements are defined where they are
2. Arecord holds all the information or data about one specific object
needed; global variables can change value at different points so
that has been entered into the database. Each individual element
it is harder to keep track of them; sometimes global variables can
of information in the record — such as a telephone number or hair
become tangled because they are called at conflicting points in the
colour — is referred to as a field.
program; it is much easier to test the code and the variable if you
Exam practice questions can do this in modules; can reduce memory required at any given
Page 33 time. (3 marks: 1 mark for each point made)
1. Two-dimensional arrays allow more complex data to be stored than 4. When a program passes data to a procedure or function, the
simple lists, or one-dimensional arrays. parameters in the procedure or function handle that data (1) so
A one-dimensional array: the procedure or function can perform operations on the data (1).

fnaex [0[3[2[9[«[5]e]7[a1 Usually parameters are included in parentheses () (1) after the

Fvawe[2[4[6[o[r0[12[14|16]16) command, such as:


int Total;
A 2-dimensional array is 'an array of arrays’, and is best shown on a int cost = 40;
2 dimensional table: int VAT= 2;
Total = sum(cost, VAT)
5. Data validation checks that data is reasonable (1), within defined
limits (1), such as SchoolAge>5<20, but doesn’t check if a user
is telling the truth (1) or whether the data input is accurate (1).
Verification checks that the input is accurate, comparing against a
record in a database.
(4 marks: 1 mark for each definition; 1 mark for each example) 6. Test data should cover normal (typical) (1), boundary (extreme) (1)
2. (a) Any of the rows — Smith, Jones, Hassan or Cengiz. (1) and erroneous data (1). Normal data is what the program would
(b) Primary key would be the employee number, because it is use regularly (1) and therefore it should accept this with no errors;
unique to each employee and not duplicated anywhere. (2) boundary data is on the edge of the range that is acceptable (1).
(c) Any reasonable number, below 30 and above 15, would be Erroneous data, such as FRED entered in an age field, should
acceptable: enough space is needed for longer surnames (1) always be thrown back (1).
but not so long that space is wasted in the database (1). 7. High-level languages are closest to human language: they need
3. ¢ Relational DB a compiler because the computer doesn't understand them,
¢ Search and sort options which also means they are slower to run. They are easy to modify
e Link to customer database because we can read them quickly. Most code is written in these
e Expandable because they can be designed for a specific purpose and are
(4 marks: 1 mark for each point made) easier to use.
4. ASCII CODE (3) Low-level languages are closest to the way the computer operates:
5. Unicode accounts for the variety of character sets (1) used by non- these are also the oldest and hardest to use. Only specific tasks are
Western languages by adding to the original content (1). written in these because they are complex to operate, but they run
faster because they're already in a language the computer can use.
Programming 3 They are harder to write and harder to update, so only specialists
Quick test questions tend to use them. (6 marks: 1 point for each point made)
Pages 34-35
1. Washing machine; dishwasher; DVD player; thermostat-controlled Fundamentals of Data Representation
heating; burglar alarm ’ $ Quick test questions
2. Depends on answer to 1. For example, DVD player: eject earrier/ Pages 42-43
1. Any one from: hexadecimal is easier (for humans) to read (than
seek disk presence/seek initial contents of disk/load context/play/
binary); hexadecimal is easier to convert (to binary) than decimal;
dismount disk on stop command.
numbers are displayed in a more compact way (in hexadecimal
Pages 36-37 than in binary); it is quicker to type in (hexadecimal numbers
1. Global: it is referenced throughout the code. than binary numbers); it is more accurate to type in (hexadecimal
2. They can be affected by the code in ways that aren't always
numbers than binary numbers).
predictable and you can end up with a variable that isn’t the value
2. bit, nibble, byte
you expect. Global variables are also held inmemory causing an
3. In decimal this is 26 + 9,
additional, if usually small, burden on the cOmputer.
00'0'11010
Pages 38-39 + 0001001
1. (a) OUTPUT “ENTER DATE OF BIRTH” 0 100011
IF DATEOFBIRTH-CURRENTDATE = >13 35
OUTPUT “WELCOME”
(b) It would include those who WERE 13 as well as those older
than 13.
(c) You have no idea if the user is telling the truth.
Answers 83
Pages 44-45 This depends on the two you select: GUI systems are
1. For example, a 64 MB hard drive would be 64*1024*1024 generally more user-friendly but tend to be locked down
bytes — 67108864 bytes. so CLI systems are often preferred by people who want to
2. It extends the ASCII character set to include non-Western ‘tweak’ settings. GUI systems are more popular and more
characters. expensive — most CLI are open-source and can therefore be
30 73H tailored for bespoke systems, while a generic GUI tries to be
a jack of all trades.
Pages 46-47
Utility programs are designed with a single purpose in mind,
1. Advantages. Good quality image and shows details and
such as clearing out unused files. They work with your OS.
range of colours.
4. The operating system manages all of the computer resources.
Disadvantages. Takes much longer to download, could stop
the rest of the page downloading while it blocks traffic and Pages 56-57
can annoy users, 1. This depends on the task, on the cores and on the RAM
2. They are useful where the detail isn't the important thing, amount and speed.
such as a map or geometric shape, where compression won't This is when an ‘instruction fetch’ and ‘data operation’ cannot
damage the product. occur at the same time because they use the same bus
which can only transfer data one way at a time.
Pages 48-49
Every piece of data has to transfer across the same bus, so
1. (a) This will depend on your name, but generally Huffman
the data transfer speed is slow and the CPU spends a lot
coding will produce a much smaller file size than simple
of time sitting waiting for the next thing. The data transfer
ASCII because each letter in ASCII is 7 bits before you
speed needs to be flexible rather than set, since some data
start. For example, the name Anna would be as follows:
is needed faster than others. Data and programs share the
ANNA 2A 2N so A could be 0 and N could be 1, using
same space, so corrupted programs could make a mess of
two bits to code the letters
(b) For example ANNA would be 65 78 78 65 — taking up 4 the data stored.

bytes of space. Pages 58-59


Exam practice questions
1. This is a matter of personal preference:
There is greater capacity in cloud storage, though large files
Page 51
take longer to upload for backup in the first place. There
190 (1)
is a question over ownership and security of files stored in
1 (1)
the cloud. Local data is cheap to purchase now but exactly
18 (1)
because it is stored locally you cannot access your data on
10100 — 1000, = 01100, or C (1)
the move.
63 (1)
Because it is cheap, because we don't need it to hold contents
01100000 (1)
for a long time: volatile memory is used as a scribbleboard that
5 (1)
we wipe ready for the next task. It is fast access memory that
oeThe computer only sees the ASCII code (1) not the letter
aber
GLP
So)
can respond to the needs of the CPU processing.
so there has to be a different code for each letter (1). The
computer outputs the code associated with the letter (1), Exam practice questions
and in human readable output we use uppercase and Page 61
lowercase letters. 1. Any three from: microphone; computer cable connection; SD
card; wireless; Bluetooth. (3 marks: 1 mark for each point
made)
Any two from the following:
(i) Difference: No moving parts in solid state media
Explanation: Magnetic media are often unsuitable
for mobile use because the mechanical parts cannot
function during movement/mechanical parts are less
01110 01000 01110 01000 01110 (3 marks: 1 mark for each robust during movement.
‘half’ of the shape; 1 mark for the sequence) (ii) Difference: Faster read access in solid state drives than
10. 16 possible colours (1) magnetic.
11. The program takes a number of samples of the sound at set Explanation: Data can often be read more quickly from
intervals (1), and works out the ‘top’ and ‘bottom’ (1) values of solid state media than magnetic media.
the analogue sound. If the sound being processed is ‘above’ (iii) Difference: Solid state media can be more compact than
the halfway point, the program checks again (1) if the sound magnetic media.
would still be above halfway if the first half was cut into half Explanation: The smaller size enables better portability.
again, and so on. ‘Above’ is recorded as a ‘1’, ‘below’ it is (iv) Difference: Less heat generated when using solid state.
recorded as a ‘0’. The number of times this is checked is Explanation: Uses less power OR allows the product
reflected in what is called the bitrate (1). These questions to be smaller. (3 marks: 1 mark for each difference;
change the number of ‘steps’ that replace the smooth sine 1 mark for the explanation)
wave: again, as with graphics, the more bits the better the False (1)
quality — and the larger the file (1). = Q is OFF (2 marks: 1 mark for Q identified; 1 mark for OFF)
Computer Systems The computer has memory that can hold data and the
Quick test questions program (1) (nowadays called RAM).
The control unit manages the process of moving the data (1)
Pages 52-53
1 Or and program between memory and storage — in the VN
2. AND design this is called the ‘accumulator’ (1).
The ALU is the calculator in the model (1). It also operates ~
Pages 54-55
relative calculations such as ‘less than’.
1. AV just protects you from wandering virus programs, a
The bus indicates the flow of data (1) between each
firewall protects you from attack from an external source,
component and is shown as arrows on the diagram.
such as a hacker.

|84|Answers /
6. The CPU reads (fetches) instructions (1) from the memory cache, or 7.
RAM (1), decodes them, and then operates — or executes (1) — the
instruction. APPLICATION LAYER
7 A large amount of RAM enables more instructions/programs to
be loaded from secondary storage into RAM (1) so they can be
executed by the processor more efficiently rather than the CPU
needing to wait for the instruction to be located and loaded. As
TRANSPORT LAYER
a result more programs may be run simultaneously, Additionally,
some programs simply need a lot of RAM to run properly (1), such
as games programs.
8. The cloud is a colloquial term for ‘the Internet’ and is often also a = ca
defined as ‘other people's computers’. The advantages for many | INTERNET LAYER |
businesses include that: |
Storage is flexible and cheaper than purchasing and managing the Sh celine ag a tts bod
hardware onsite.
Offices across the world can access the same files.
NETWORK ACCESS
Local disaster recovery is easier — as long as your storage provider
(or DATA LINK) LAYER
wasn't the one hit. (3 marks: 1 mark for each point made)

Fundamentals of Computer Networks


(4 marks: 1 mark for each completed entry)
Quick test questions
8. Ring (1)
Pages 62-63
1. This depends on the size of the network and the composition, but Cyber Security and Ethics
most schools are star network because this is the most stable and Quick test questions
can be most easily extended. Pages 70-71
2. Generally anyone mobile is better off with wireless tech if they are 1. Because USB storage is unreliable since it can be used in a
moving about (the DJ and their microphone for example) but if they number of different devices, and because the software on the
are working static (like a photographer) then they can use wired device might be malicious, so the software could copy itself across
and benefit from the faster and more secure data transfer. devices using the USB storage as a transport — unless the system
is secured it will be vulnerable to any threat from outside.
Pages 64-65
2. Yes —corrupting software that allows access to network files can be
1. If they're on a tight budget, a bus network would probably give
transferred to a computer system through a removable device: a
them the flexibility of access to resources that they need. That said,
firewall would question the unauthorised access.
itis vulnerable to all sorts of crashes, so a ring would be a better
3. It pretends to come from a legitimate source, such as a bank, and
choice, with a star the best and most flexible option.
asks for your details.
2. Awhitelist is stronger because it blocks everything first, and then
checks whether that connection is allowed. A blacklist allows Pages 72-73
everything first, then checks whether the connection is allowed. 1. This depends on the system — fingerprint is cheapest and often the
most reliable, but wouldn't suit a top-secret vault: the more secure
Pages 66-67
eye or retinal scan would suit if money is no object.
1. File Transfer Protocol.
2. Software companies prefer to be able to update software on time to
2. True
avoid the poor reputation of being vulnerable to malicious attack.
3. IMAP leaves a copy of the message on the server, SMTP draws the
This isn’t always at a time that is convenient to the user. There is also
files down to the local machine.
sometimes a concern about the amount of personal data available
Exam practice questions to the company as a result of the arrangement, since all settings
Page 69 have to be visible to their system for the update to take place.
1. Wired, where the computers are stationary (1) to ensure security
Pages 74-75
(1); then wireless for all portable devices to ensure that their
1. Because what we do in the electronic or virtual world has effects on
main asset — portability- is maintained. This will help limit the
the real world, and we can only exist together if we agree what is
opportunities for hacking, especially if the WEP password is
‘right’ and ‘wrong’. :
changed on the router (1).
2. Yes, if it is computer-controlled with a login system which has been
2. When there are very few workstations on the network (1), and all
compromised.
resources are easily shared (1).
3. No-they’re not 18, but the adult with responsibility for them can do
3. This makes data appear meaningless (1) and provides security (1)
so.
for the content both when stored electronically and when transmitted
using an encryption key. This is particularly important when storing Pages 76-77
and/or transmitting personal data (Data Protection Act). & lel C AR N S Pole Ai deh oS:
4. Avwhitelist identifies authorised sites (1) if on an Internet filter, or 2. Encoding changes data into a format that can be processed,
users or machines if on a firewall (1). Only those on the whitelist are usually by computers, such as M = Male, F = Female, DOB =
allowed through. This is more secure than the opposite blacklist (1) Date Of Birth. Encryption changes data into a format which can
because that simply bars only those entities identified on the list: only be read by those with the key — who should be the authorised
the whitelist bars everything except what is on the list (1). recipients of the message.
5. This refers to the balancing of workload between the user's Exam practice questions
computer (client) and the host computer (server) (1) so that the Page 79
transaction is concluded more quickly (1). Generally the server 1. Malware is designed to damage your code or computer; adware
computer is more powerful, so it holds user data and does the fills your computer with ads, sometimes making them pop up in
harder work. your browser when you are searching for something online. (1)
6. WAN, group of WANs, group of Stars, mesh of Stars (1). 2. Copyright, Designs & Patents Act. (1)

Answers 85
Arguably, there is a fine line between these two. Blagging Te Thousands of security threats are discovered in a year (1),
tends to be more personal (1) while phishing tends to be and the software companies are always writing code to
pretending to be an organisation (1), but both seek to fool ensure that their product is resilient (1) against the attacks
you into giving your personal or confidential details away. from the threats they discover. If you do not update your
No (1). The USA is regarded as having sufficient data security computer, then the threat remains (1).
measures in place (1), though this is now a grey area as a Any three from: social networking fast to transfer so harder
result of the revelations about the NSA and GCHQ monitoring to censor; has a global reach so can reach more people
Internet transactions. more quickly than other media; lack of central control by a
It is hard to read and the ‘sound’ option often isn’t clear government because the data is stored in another country;
enough. (1) allows incorporation of text with images/video/sound. (6
Biometrics such as retinal scans are the most secure but marks: 1 mark for each comment, 1 mark for explanation
are also expensive to add to existing hardware and can be of impact)
difficult to reprogram if and when the teacher leaves the
school. A password is the cheapest system, but it can often
be the weakest as well if the password is easy to break.
Usually the data on a teacher's laptop is encrypted and the
teachers are required to change their passwords frequently,
so that there is less of a chance that the laptop data will be
compromised using this system. (5 marks: 1 mark for each
point made)

}86|Answers
4-bit structure 42-44 databases 28-31
8-bit structure 42-44 data compression 48-49
Data Protection Act (1998) 65, 75-77, 79
abstraction 5 data representation 42-51
access levels 73 data structures 22
algorithms 4-11, 74 data types 12-13
ALU (Arithmetic-Logic Units) 56-57 DBMS (Database Management Systems) 30-31
analogue 47 decimal base 42
anti-virus software 73 declaration 13
application software 54-55, 70 decomposition 5, 31, 34
arguments/parameters 36-37 decryption 65
arithmetic 16, 42-43 defending cyber threats 72-74
arrays 6, 22-23 definite iterations 13
ASCII code 26-27, 45, 77, 80 descending 8-9
assignment statements 13 disk drives 59
attacks 70-73 DNS (Domain Name Systems) 67
authentication 38-39, 65
efficiency 4
backdoor Trojans 70-71 embedded systems 39, 58
binary arithmetic 8, 43 encryption 29, 65, 73, 76-77
binary searches 6-7 ethics 74-75
biometrics 72-73
bitmap files 46-47 fetch-execute cycles 56
bitrate 47 fields 30-31
bits 42-44 file handling 24
blacklist 65 firewalls 55, 65, 70-71, 73
Boolean data 12-13 flowcharts 5, 18-19
Boolean logic 52-53 foreign keys 31
Boolean operators 16-17 Freedom of Information Act (2000);
bubble sort 8-9 (Scotland 2002) 75
buses 56-57 functions 13, 34-37
bytes 43-44, 46, 49
global subroutines 37
Caesar ciphers 76-77 graphic files 46
characters 12, 26-27, 45, 48-49
ciphertext 76-77 hard drives 45, 55, 58-59, 73
classifying software 54-55 hardware 64-65, 67, 70, 72-73, 75
client-server architecture 66-67 hashing 76-77
clock-digital circuits 57 hexadecimal bases 42-43
clock speed 57 high-level language 35, 39
cloud computing 58-59, 74 Huffman coding/trees 48-49
colour depth 46-47
compression 47-49 identifiers 6, 13
Computer Misuse Act (1990) 75 image representation 46-47
computer networks 62-69 indefinite iterations 13
computer systems 39, 58, 70-74 information, units of 44
concatenation 26-27 input/output 18, 24-25
constructs 12 integers 12-14, 27
control unit 56-57 IP (Internet Protocol) 66-67
copyright 74-75 iteration 12-13
Copyright, Designs & Patents Act (1988) 75
cores 57 JPEG (Joint Photographic Experts Group) 46-47
CPU (Central Processing Units) 56-58 .,
.csv (comma separated values) 24-25 keyloggers 70-71
cyber security 70-73, 76-78
language classification 35, 39 sample resolution 47
LAN (Local Area Networks) 62-63 sampling rates 47
law and ethics 75 searching algorithms 6-7
leading zeros 43 secondary storage 58-59
linear searches 7 security 29, 38-39, 65, 70-73, 76-78
local subroutines 37 selection/choice 12-13
logic gates 52-53 sequence 12-13
low-level language 35, 39 shifts 43
software 52-55
MAC (Media Access Control) addresses 65 sorting algorithms 8-9
malicious attacks 70-73 sound representation 47
malware 70-71 spyware 70-71
memory 56-59 SQL (Structured Query Language) 30-31, 71
merge sort 8-9 SSH (Secure Shells) 67
metadata 46-47 SSL (Secure Sockets Layer) 77
storage 56-59
nested constructs 13 stored-programs 56-57
networks 62-69 strings 12, 26-27
nibble/4 bits 42-44 structured programming 34-35
number bases 42-43 subroutines 13, 34-37
substrings 26-27
one-dimensional arrays 22-23 systems architecture 56-57
operating systems 54-55 system software 54-55
optical drives 59
TCP (Transmission Control Protocol) 66-67
packets 66-67 testing 38-39
PAN (Personal Area Networks) 63 threats 70-73
parameters/subroutines 36-37 topology of networks 64-65
personal data 75 trace tables 4-5
pixels 46-47 Trojan horses 70-71
plain text 76-77 truth tables 52-53
ports 65 two-dimensional arrays 22-23
primary keys 22, 31 txt (text files) 24-25
procedures 13, 34-37
processors 56-57 Unicode 45
protocols 66-67 utility programs 54-55
pseudocode 6-7, 14-17, 22, 27-28, 36
pseudorandom numbers 28-29 validation 38-39
viruses 70-71, 73
RAM (Random Access Memory) 56-57 volatile memory 56-57
random numbers 28-29: Von Neumann architecture 56-57
real data 12
records 22-23 WAN (Wide Area Networks) 62-63
register 43, 56-57 whitelist 65
relational databases 30-31 wired networks 63
relational operators 16 wireless networks 63, 66
repetition/iteration 12-13 worms 70-71
resolution 46-47
RLE (Run Length Encoding) 48
ROM (Read Only Memory) 56
Ad}NdwWIO,
BDUDIDS
ai)¥

(ae

Exam Practice Workbook


Fundamentals of algorithms
Module 1: Representing algorithms

Module 2: Searching algorithms

Module 3: Sorting algorithms

Programming 1

Module 4: Data types

Module 5: Pseudocode

Module 6: Arithmetic, relational and Boolean operators in programming languages 12

Module 7: Flowcharts 14

Programming 2

Module 8: Data structures 16

Module 9: Input/output and file handling 17

Module 10: String handling 18

Module 11: Random number generation in a programming language 19

Module 12: Databases 20

Programming 3

Module 13: Introduction to subroutines and structured programming 21

Module 14: Parameters and subroutines 22

Module 15: Robust and secure programming 24

Fundamentals of data representation


Module 16: Number bases and binary arithmetic

Module 17: Units of information and character encoding

Module 18: Representing images and sound

Contents
Module 19: Data compression
Computer systems
Module 20: Hardware, software and Boolean logic 30

Module 21: Software classification 32

Module 22: Systems architecture 33

Module 23: Secondary storage 35

Fundamentals of computer networks

Module 24: Definitions and types of networks 36

Module 25: Network topology 37

Module 26: Communication protocols 38

Cyber security and ethics


Module 27: Definition, purpose and threat 39

Module 28: Detecting and preventing threats 41

Module 29: Ethics 43

Module 30: Encryption 45

Practice exam papers


Paper1 46

Paper 2 57

ASCII table 64

Answers 65
4 Define the term ‘algorithm’. [2 marks]

es Explain the purpose of the algorithm set out in this flowchart. [3 marks]

START

CURE UT:
“COUNTING...”

LoopCounter = 0 LoopCounter = LoopCounter + 1


i
=
abs Is LoopCounter

— eety

a
@
=
i)
5°)

wed
=
Y 3 | Draw a flowchart to describe an algorithm to print all numbers divisible by 3 up to 100. [5 marks]
wi
aw
hea
em
w
aa

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 4-5. SK.

4 |ty:
(tl (a Representing algorithms
4 | State two properties of an algorithm that could be considered when describing
it as ‘efficient’. [2 marks]

Gi A student needs to open and edit a password-protected file.


Put the following steps into the correct order: [5 marks]

Edit Data

Save and Close

Enter Password Wi
=
Select Program
=
Select File and Open
a
pa
6 | Define ‘iteration’ in the context of designing a program structure. [1 mark]
°
=
[2 marks] 6
D
=
=
aed
[2 marks]
gdWi
Ydees
2.
9 | Explain how a trace table is used to test a computer program to check
Y
for early errors. [2 marks]
ce

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 4-5.

Representing algorithms ByCl Ute al


ae Explain the steps involved in a binary search. [4 marks]

Fal Explain how a linear search looks at a data source. [2 marks]

£non
Wi ben Identify what type of search this is. [1 mark]

|classtist= [‘Alex”, “Riley”, “Chris”, “Bailey”, “Jamie”]

=
INPUT A #name you’re looking for
FOREACH [item in list]:
Bes TE teem) ==A-
©
Df
OUTPUT result stop search
ELSE
RETURN

f°))
f=nfo 4 | Linear search is often also known as ‘brute force’ searching.
ud [1 mark]
am Why is this?
©
v
Vi
[3 marks]

r
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 6-7.

AB Module2 .Searching algorithms


Gi Explain when a linear search might be more efficient than a binary search. [2 marks]

At first glance, which type of search would be the most appropriate for the
following data?

Give a reason for your answer. [2 marks]

| want to find if there are any ‘9’s in the list:

i 2,0,4,0,0,7,8,9,10,11,12

vi
=
8 |Which would be the most appropriate type of search for the following data? a
=
Give a reason for your answer. [2 marks]
tn
©
| want to find if there are any Hussains in the class:

“Adams”, “Banks”, “Kelly”, “Madsen”, “Lisson”, “Hepworth” ©
Gi
i=
rcs
Ww
red
fe
i)
V)

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 6-7.

Searching algorithms By C.-( Gy:


eu Which of the following processes describes merge sort? Tick one option. [1 mark]

A Repeatedly splits the data in half until each ‘list’ contains only a single
data item. Then, having broken it into smaller parts, it repeatedly
combines these ‘lists’ back together, this time putting them in
their required order (ascending or descending in value). [a

Compares the first two items, checks which one is larger


and swaps them if necessary so that the larger is first.
Then it checks the next pair, and so on. L

2 | Use a bubble sort to sort the dataset (6,2,4,1,8) in ascending order. Show your
working and state the number of steps required. [4 marks]

Wi
=
a
=
a
2)
ty [3 marks]
ce
Got
=
we
a
=]
V)

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 8-9.

3 | terete i Sorting algorithms


Ee What is a ‘Boolean data type’? [1 mark]

2 Explain what type of data a telephone number is. [3 marks]

[3 marks]

[1 mark]

5 |What does the phrase ‘constant declaration’ mean, and how is it different from
declaring a variable? [4 marks]

6 | ‘Repeat’ instructions like the one below are an example of which technique? [1 mark] Data
typ
(NB fd = ‘forward’, ‘rt’ = ‘right’ followed by the degrees to turn)

Repeat 360 [fd 1 rt 1]

+
co
[4 marks]
5
"oO

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 12-13.
ae Give a definition of ‘pseudocode’. [2 marks]

ey Write the pseudocode for a simple algorithm that is used to process data entered
by aclass teacher. It prints ‘passed’ if a student's mark is above 30, and
‘did not pass’ if it isn't. [2 marks]

fe Explain what the following code does. [3 marks]

wy

n=0
while n<=100

©
display n

i
n=n+1
endwhile
Q

rs
qs
ue
he

For more help on this topic, see Letts GCSE Computer Science Revision Guide page 5 1 :
4 | Explain what the following code does.

input startnumber, finish


if startnumber > finish
print error message
else
for n=startnumber to finishnumber
print 1
next
endif

G Write the pseudocode to take three numbers as input and print the sum
and product of those numbers.

a
"oO

@
es
©
"Oo

=
wy
vi
ib.
:

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 14-15.

modules
ate Write a simple program to multiply two user input numbers together, and
print the result. [1 mark]

languages

re Explain why the following two codes would display and produce different results. [3 marks]

programming
in
wi
as a:=13 a= 13
° b=2 Die
ctha
ee

c = INT(a/b) c = FLOAT(a/b)
7)
2. print Cc print c
°
S
©
=
°
0
ca
c
=
6
G
= 3 | Explain why the calculation in this program would cause a problem. [1 mark]
S
6
ales!

7
the
input
input
Name
Age

= Score =

7
ae! Name*Age
Print Score
=
>
=
Sos
x

Module
6
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 16-17.
4 |The following code aims to work out overtime pay.

Describe why it is incorrect. [2 marks]


langu
Input EmployeeName
Input HoursWorked
Input HourRate
Input OvertimeWorked
Input OvertimeRate
pay (HoursWorked / HourRate) + (OvertimeWorked * OvertimeRate)

prog
in

[2 marks]

a a5
Da 23
Teecw< 1.0 AND =b) < 50
print “Class Dismissed”
ELSE
print “Extra Homework!”
ENDIF

6: If line three in question 5 is changed to:

fps lO AND! by < 50


print “Class Dismissed”
Boole
and
relati
Arith
opera

what will be the result, and why?

©
=
5
"oO

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 16-17.

Arithmetic, relational and Boolean operators in programming languages MCT UC"


ae What do the following flowchart symbols mean? [4 marks]

[4 marks]

Wi
oss
then
ge
en
as
>
=
oo

Output “Acceptable
range”

(EERIE Fowchor
oa Put the flowchart elements below in the correct order to monitor the
temperature in a greenhouse. [2 marks]

READ PRINT “CLOSE PRINT “TEMP


TEMPERATURE WINDOWS!” FINE!”

wi
de?
was
©
——
WJ
=
2
Babi:

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 18-19.
eA Black and white bitmap images can be encoded using 1 to represent white
and 0 to represent black in a two-dimensional array. Show the two dimensional
array for the capital letter C where the array is 4 pixels by 4 pixels. [2 marks]

re In programming, what are ‘data structures’? [2 marks]

ey If a list contains the following elements, what would be output by the command
print (text[2]) if the array count starts at [0]? Give a reason for your answer. [2 marks]

yt ym, ny,
text = [“apples”; “oranges”; “pears”; “bananas” ]

a Is this acceptable data for an array? Give a reason for your answer. [2 marks]

names = [“Max”,“Khali”,22,“Sam”)

5 | lf a two-dimensional array is defined as below, identify how many elements


are contained within it. [2 marks]

Data
structures
myArray(6,6)

6 | In the list below, identify the item at index point [5] if the index starts at [0]. [1 mark]

00
~
(1,2,3,4,5,6;7,5,9)

=
"Oo

° [1 mark]

=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 22-23.

terete: Data structures


Aa Describe what this code would do. [4 marks]

file = open("contacts.csv", "a")


name = input("Please enter name.")
phone = input("Please enter phone number.")
file.write(name + "," + phone + "\n")

Fa Describe two ways external data can be collected. [2 marks]

Ka Describe how an index aids file handling. [2 marks]

4 | Explain why it is possible for someone to enter a chatroom for 20-year-olds


and be only 15. [2 marks]

[2 marks]

open("classlist.csv", "a")

input("Please enter name.") han


file
and
Inp
(name ae mows "\n")

6 | If a file is opened, edited, saved and closed on a daily basis, identify a


limitation of this method and a possible solution. [2 marks] O71
=
5
"oO

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 24-25.

input/output and file handling BuCr MG 7


ae Define the data type ‘string’. [2 marks]

ea Complete the following table to show which data you would store as an integer
and which you would store as a string.

Tick one box in each row. [4 marks]

Data type Store as an integer Store as a string

15 fe
(CS
2010

01501 2987659
3 If the following variables are given string values, what would be the result when
they were concatenated in the same order in which they were entered?

Give a reason for your answer. [2 marks]

one =) SElsh?
two = “chips”
three = “mushy peas”

nai A string can also be an array of characters:

handling
String one = me of Se Ans |

lf a function returns the numeric character code, and the character code for
one[1] is 105 and the character code for one[3] is 104, what is the character
°
|
code for one[0]? | [1 mark]

=
= Po) Explain why a character encoding system uses a different
[1 mark]

o
code for upper- and lowercase letters.

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 26-27. RA

18 Wier CwCe String handling


BE Explain the difference between a random number and a pseudorandom number. [2 marks]

Fy Describe two modern uses of computer-generated random numbers. [2 marks] lang


ing

KR Explain what the following code does. How does it use the random feature
within the language? [4 marks]

import random
My _ number = random.randint(1, 100)
guess = int(input("Take a guess: ")) prog
a
in
ion
©he
Ld
tries

7
# guessing loop
<
while guess != Mynumber:
7
if guess > Mynumber: =
print("Too high!")
7
ts
else:
print("Too low!") 2
endif =
=
<
guess = int(input("What is your guess: "))
cre se =i
endwhile 3
print("You got it! The number was", Mynumber) °
print("And it only took you", guesses, "tries!\n") o
<
G
oc

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 28-29.

Random number generation in a programming language BUCCI Ca 19 |


ae Explain the difference between a flat file and a relational database. Support your
answer with examples. [4 marks]

2 |What is the role of a primary key? [1 mark]

3 |Giving examples, what is the difference between ‘structured’ and ‘unstructured’ data? [4 marks]

na State the purpose of a database report. [1 mark]

V~i
wy see75 | T-shirt 7 [Blue |S Bs
Wi Trainers [Black [6_—s*d £29.99
© [333548 [Hoodie [Red |M_ £29.99
ms) Shirt £12.99
©
gad
£6.99
©
C
SELECT * FROM StockList
WHERE Size=’M’
AND Colour='White’
sibeasalb ails cen asus sores nicipwavsisbunsacu het eae [1 mark]

SELECT * FROM StockList


WHERE Size=’M’
AND ProductType='‘Shirt’
RT A Rl. fe me [2 marks]

SELECT * FROM StockList


WHERE Cost<£20.00 [4 marks]

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 30-31. a

yim Module 12
ay Give three reasons why using a structured approach to their code will benefit
a programmer. {3 marks] =)
i

be
(°)]
>)
Es Within structured programming, good programmers plan what they intend to Shoe
a.
do, then comment the code as it is constructed. In this context, what is a
x?)
comment? Give an example. [2 marks] 7]
fea
=
ees
ed)
=
ba
Lory
Wi
mo)
La
©
Wi
3 | Describe the three types of translation programming software and provide a Y
brief description of each. [6 marks] =
Esc)
=
=)
be
me]
=)
Wn
Oo
RS

c
2
ae
Ww
=)
TS
&
4 |Describe the steps a programmer can take to make the code they write -
easier for another programmer to follow. [4 marks] =

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 34-35.

Introduction to subroutines and structured programming #07. CRE Ey


PAG Name a parameter within this function. [1 mark]

FUNCTION Testl(name, value)


IF name[1] = value
RETURN true
ELSE
RETURN false
ENDIF
ENDFUNCTION

3 |A school is developing a part of its website to allow parents and students to upload
images. They need a subroutine that would check that the image is within the maximum
size allowed (1 MB) before uploading only those that are the right size.

Write a pseudocode subroutine that would do this. [6 marks]

subroutines
and
Parameters

+
\

=
5
"So
FD (x) moves the robot x squares forwards
LT (x) turns the robot x degrees left

°
RT (x) turns the robot x degrees right
Obstacle() is a Boolean response to the status of the robot

=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 36-37. '

ity: (tie a Parameters and subroutines


(a) What would be the path of the robot through the grid below if the
following code was executed? [1 mark]

A
START

(b) What would be the path of the robot through the grid below if the
following code was executed? [1 mark]

WHILE Obstacle= TRUE:


FD (1)
LT (90)
FD (4)
RT (90)
ENDWHILE
FD (2)

(c) Write the code for the path of the robot through the grid below from
START to END. [1 mark]

sub
and
Par

Y
=

=
=
oS

0
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 36-37.

Parameters and subroutines BuuCr Cae!


ta A program is only as good as its data. Explain how validation and verification
can help ensure that the data is as ‘good’ as possible. [6 marks]

=)
f=
=
=
A)
os
D ra Describe one method of validation used by online surveys to help them manage

°es the quality of their data. [2 marks]

2.
Y
=iw
ase 3 |Validation is required for the data in the parameters for the function below:

@Wi Function WorkingTime (Timeln,TimeOut)

"Oo Set a test, and show an example of invalid data. [2 marks]

=
i
nee
Wi
5 [2 marks]

2
°
oc
5 |A program requires a date of birth from the 20" century to be entered. Provide normal,
extreme and erroneous test data examples in the format DD/MM/YYYY. [3 marks]

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 38-39.

}24|WiC Cee Robust and secure programming


a -
Va Explain why programmers use hexadecimal instead of binary. [3 marks]

ic
2 |What is the decimal representation of the hexadecimal number A2?

Show your working. [2 marks]


thm

FEY What is the binary result of 00000111 + 00000111?


Show your working. [2 marks] ari
ina

4 |What is the hexadecimal representation of 256?

Show your working.

b
and
bas
Num

0
\ oe

=
5
"Oo

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 42-43.

Number bases and binary arithmetic BC) Gat


=)
=
© }
ae Each unit in binary is called a ‘bit’, and a single bit in binary can represent one of
two numbers, O and 1.

How many numbers can be represented by:


\°)
J)
(a) 3 bits? [1 mark]
c
ae) (b) 8 bits? [1 mark]
thea
el) (c) 12 bits? [1 mark]
ed
i) Pal Describe how 1 bit per pixel can be used to represent this image. [1 mark]
©
ae
4
mhos
wd
© }

&.
cs]
¢
2
Pera

:
© [1 mark]

a
\e)]
£
Sefaes ZF If a kilobyte is 1024 bytes and a megabyte (MB) is 1024 kilobytes,
fill in the gaps for the following sizes. [2 marks]

Seger:
A gigabyte (GB) iS 0 24c eee ee eee
0
Wi A terabyte (TB) is 1024 oo. PR ie OPE ae cor!
So 5 | If a robot has a 4-bit instruction set, how many individual different instructions
= can it operate?
=
Give a reason for your answer. [2 marks]

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 44-45.

|26|WY as Units of information and character encoding


0)
6 |On a computer monitor, state how many colours are displayed by 8-bit colour. [1 mark]
£
a ©}

Define ‘colour depth’ and state how it affects file size. [2 marks] \e)
Lo

ve)
tee
eT)
ae?
adi
8 | Give a significant disadvantage of ASCII code that led to the development of ©
ka
Unicode. [2 marks]
f
hens
td
"So
¢
©
f
2
wit

-
G

Sue
‘e)
£
ele

has
Le)
Wi
pe
¢
|

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 44-45.

Units of information and character encoding Bull. UiCar,


Oe Sound, which is naturally analogue, is converted into a digital format through sampling.
What is this process, and what impact does the sample rate have on file size? [4 marks]

Ea) Define what ‘bit depth’ is and what impact it has on the quality of the sound. [2 marks]

3) Two versions of the same tune, with the same sample rate, have very different file sizes.
Explain why tune.wav is 50.4 MB and tune.mp3 is 3.43 MB. [2 marks]

a State what is meant by ‘resolution’ of a monitor. Explain what impact resolution has
on the quality of graphics displayed. [4 marks]

sound
and
images
RepresentingGi A JPEG file format uses lossy compression. Explain what this means for both the
quality of the image and the size of the file. [3 marks]

00
\ me
[2 marks]

=
S
s
°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 46-47.

28 ty.
(1 (ME. Representing images and sound
ah Describe what a ‘Huffman tree’ is and what purpose it serves. [2 marks]

Rea Describe what ‘Run Length Encoding (RLE)’ is. [2 marks]

Ey Describe an example type of file where RLE is commonly used. [1 mark]

IY 4 Huffman tree for the text 2012 LONDON OLYMPICS is shown below.
Complete the missing sections. [5 marks]

com
Dat

O
\ me

=
5
"Oo

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 48-49.
ee A client complains that their laptop computer is running very slowly, even though
their anti-virus software is up to date.

Give two examples of how utility software could help free up some space on
the hard drive. [2 marks]

On the motherboard, which element is used to connect different components


in the CPU?

Tick one option. [1 mark]

Port

Firewire

Network

Bus

Define what ‘hardware’ Is.

A client complains
that their laptop is
running very slowly, even
though their
anti-virus software is up
to date, and they do not
have a lot of data on their
hard disk.

software
logic
Boolean
and
Hardware, How could adding to the
memory in the laptop help 7 . a
to solve this? rip . 3 [2 marks]

°
N
=
5
"oO

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide page

ity Twi Hardware, software and Boolean logic


5 | Complete the following truth table for an OR logic gate. (2 marks]

sind
D
2
=
6
6 |The image below is a black and white image of 25 pixels. fe
Explain why 25 bits would be needed to represent this image. [2 marks]
=)
-)
ee
"oO

=
6
Ythers
6
by
sd
>
So:
GS
Vi

a
6
thee

>
"oO

6
abe

ke

Mod
20
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 52-53.

Hardware, software and Boolean logic Bu Cy.(" Fy4y)


Ke System software and application software are two different types of software.
Give one example of application software. [1 mark]

os Which of the following is an example of a utility program?

Tick one option.

Spreadsheet [|

Anti-virus checker Lana

Internet browser [|

=
3 What is ‘open source software’? [1 mark]

2
©ed
he 4 | Explain the main difference between a Command Line Interface (CLI) anda
Graphical User Interface (GUI). [4 marks]

=Vi
Lh
da
ag
Y [5 marks]

©
whe

>
wien!

°
Shes

v)
[2 marks]

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 54-55.

32 |WC esi Software classification


aa What is the difference between volatile and non-volatile memory?

Give an example of each. [3 marks]

eal State what a ‘Von Neumann bottleneck’ is. [1 mark]

3 | Describe briefly the ‘fetch-execute cycle’. [1 mark]

w
Bo
ae
[2 marks] spd
es
@
=
5 | Below are three different types of memory.
woheas
ed
doz
Tick the fastest from these types of memory. [1 mark]
mS

f
Level 1 cache [aia]

RAM ee
a)
Level 2 cache [| ed
Ww
a
Vv)

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 56-57.

Systems architecture BCT. "Cy: ry


=
6 |When might a computer use virtual memory? [1 mark]

Describe why a computer uses cache memory. [2 marks]

ee What is a ‘bus’ on a motherboard?

9 | In addition to the CPU clock speed, name two factors that can affect the CPU's
performance. [2 marks]

YShas
5
ipa!
te
Y
—_
=i
Some
6
Wi
=
Y
wet

>
Wi

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 56-57.

|34|trite Systems architecture


pu In addition to solid state and magnetic storage, name a type of secondary
storage and give an example. [2 marks]

ee What is the difference between a ‘-R’ and ‘-RW’ in relation to an optional disc? (2 marks]

cy A small organisation wants to transfer all its data onto a cloud storage plan.
Discuss the advantages and disadvantages of this option. [8 marks]

a
ed
We)
bes
@
og
Vi
om
be
®
"oO
4 | Explain, using an example, what is an ‘embedded system’ is. [2 marks]

See
@
VW
@
Vv)

5 |Tablet computers and mobile phones tend to use solid state media for storage rather
than hard drives. Describe two reasons, other than cost and capacity, why solid state
is used. [4 marks]

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 58-59.

Secondary storage Buy. ye} |35|


| What is a ‘Personal Area Network (PAN)’? [2 marks]

va Explain the difference between a local area network (LAN) and a wide area network
(WAN). Give an example of a situation where each might be used. [4 marks]

3 |Which type of networking (wired or wireless) would you recommend for a small office
with four people who use laptops and share a printer? Explain your answer. [5 marks]

networks
of
and
ions
types
os “Schools should ban all onsite wireless connectivity for students.”
Discuss this statement. [8 marks]

Def

+
N
=
"Oo

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 62-63. a

tye (it-w2 a Definitions and types of networks


ila Describe the differences between a star network topology and a mesh network
topology. [4 marks]

ey Draw an example of a ring network topology, showing clearly each of the components:
printer, storage/server, three workstations. [5 marks]

a
D
=
°
2.
°
Pag

wees
°
4 | Identify the difference between whitelist and blacklist filtering. Explain which is the
>
Y
more secure. Explain which is more flexible. [4 marks] ae

ipa Why is a ring network vulnerable to system failure? [2 marks]

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 64-65.

Network topology But. Cys


a Draw a diagram identifying the basic four layers of the Internet. [4 marks]

ia Describe the purpose of the ‘Transport Layer’ of the Internet.

[2 marks]

na Client-server communication:
Tick one option in each case, showing whether the action would take place at the
client end, server end or both. [3 marks]

[Action
——~S*dYSCSLIENT |SERVER [GOTH _|
Starting arltieke | |aen n
[Displaying
protocols
Communication
HTMLpages|) |
Incr a
5 | Describe what the ‘client-server model’ is. [2 marks]

©
N
= 6 |What elements may be found on the ‘application layer’ of the 4-layer Internet model?

5

What purpose does the application layer serve? [2 marks]

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 66-67. e

tye
(11 (-X-3 Communication protocols
ae In the context of cyber security, what is a ‘Trojan horse’? [2 marks]

2 | What is ‘good password practice’ in terms of security? Give four examples. [4 marks]

iE Explain why, when you forget your password, the company holding your account
should send you a link to reset your password, not a copy of your password. [4 marks]

[2 marks]

thre
ion,
and
pur
[3 marks]

fj
os
O
[4 marks]

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 70-71.

Definition, purpose and threat But: py, 39 |


How is ‘malware’ a threat to a network? [2 marks]

8 | Why do networks have access levels for users?

Tick one option. [1 mark]

To give everyone access to download any files they want. [ai

d
threat To control the access different users have to information. Ei

To let the network manager know who is doing what on the network. i

FJ) What is Distriouted Denial of Service (DDOS)? Describe what it does to a


web server. [4 marks]

[2 marks]

purpose
inition,
an
‘ce
os
O
11] Why is it important to keep all software up to date, especially on a device that is
attached to the Internet? [4 marks]

—!

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 70-71. "8d
pa

|40 | itv. wyae Definition, purpose and threat ,:


a Define the term ‘encryption’. [2 marks]

ra What is the difference between encryption and encoding? Explain with examples. [4 marks]

[4 marks]

[1 mark]

[4 marks]

thre
pre
and
Det
6 | Modern organisations are spending increasing amounts of money on cyber security.
This includes penetration testing, which is an attack by an organisation on its own
computer system to identify weak points. What is the difference between black and
00
white box penetration testing? [4 marks]
al
=
=
"oO

°
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 72-73.

Detecting and preventing threats B'(y.


(1 [2:3
Identify two advantages and two disadvantages of a basic password system. [4 marks]

Vi
wee
te
a
thes [2 marks]
sus
ie

G)
{=
dhe
[2 marks]

c
a
a
@
des
&. [3 marks]
"oS

es
#3
Sy
=
ew
ed
@
aha
@:
O

Module
28 ~

For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 72-73. xa
st

42 By (wt: Detecting and preventing threats i


|
8
et} The EU ‘right to be forgotten’ ruling allows individuals to request online data held about
them to be erased. Many are concerned however that this may aid criminal activities.
Whose rights should be prioritised? Give reasons for your answer. (6 marks]

[6 marks]

Ethi

ns
oo
a THINGS |

ce
fi
O71
N
~
©
=
"Oo

4
=,
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 74-75.

ing Module 29
> -
3 | What are the security considerations for data storage in the ‘cloud’?

Do you think these are outweighed by the convenience of this sort of storage?

Explain your answer. [6 marks]

4 | Explain how a social network, based in the UK, must comply with the Data
Protection Act. [6 marks]

Ethics

O7
S*Wiekcore to
Fick- Proto’Shaing 7

@| flickr

N REST G
se -
us
0
.

he
5
"oO +

& = 2 Torte ine wa orcs Pes ts

©
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 74-75.

Module 29 Ethics
ia What is a simple ‘Caesar cipher’? [1 mark]

3 Here is an example of a Caesar cipher:

A\B/C/D/E/F/GH/1/J/K/L/m|N/O|P/QiR|/s|T|U x viwix|y¥
ELFIG/H} 1]y[k]L|M|Njo[Pjajals|tiulv|w]xly]z]a]B|
Using the Caesar cipher above, decode this message. [1 mark]
CYOA YKILQPAN OYEJYA

Ky How does hashing enhance the security of a sent message? [1 mark]

(1 mark]

5 | Describe two reasons why encrypted data cannot be understood by an unauthorised


[2 marks]

[2 marks]

A familiar method of encryption is SSL. Explain what SSL is and how it works. [4 marks]
Enc

oS
en
=
5
"oO

=)
=
For more help on this topic, see Letts GCSE Computer Science Revision Guide pages 76-77.

Module 30
a“a97 7
thls

GCSE

Computer Science

Paper 1 Time: 1 hour 30 minutes

For this paper you must have:

e mathematical instruments

You must not use a calculator.

Instructions

e Use black ink or black ball-point pen. Use pencil only for drawing.
e Answer all the questions.
e Answer the questions in the spaces provided.
e Answer questions that require a coded solution in whichever format you prefer, as long as your
meaning is clear and unambiguous.
e You must not use a calculator.

Information

e The mark for each question is shown in brackets.


e The maximum mark for this paper is 70.
e Remember to use good English and clear presentation in your answers.

46 |Practice exam paper 1


1 State what 10010111 is translated from binary to decimal. [1]

2 State what 125 is translated from decimal to binary. [1]

3 Below are three types of memory. Tick the name of the type of memory used to make up
for the difference of speed in function of two internal components of a computer. [1]

ROM i cache [| volatile f

4 Anearly form of cipher is known as a Caesar cipher, as shown below:

EC A a EG
a) Explain how the Caesar cipher works. [2]

b) Use the Caesar cipher above to decode the following: [3]

5 a) What is the ‘client-server model’? [1]

b) Explain how it aids effective data transfer across the Internet. [2]

Practice exam paper 1 iy


6 From the options below, identify (tick) one reason why hexadecimal is used to represent data. [1]

Hexadecimal is quicker for the computer to interpret. fal

Hexadecimal takes up less memory in the computer. wil

Hexadecimal is easier for humans to read. Bl

7 A\list is made up of the following numbers:

58,34,2,4,39,54,1

Show the steps involved in sorting it using merge sort. [2]

8 The algorithm below is designed to search for a value within a list.

Cangetbecres0
lisieie cect |Ppse yelp sist
found <- false
ib acaoy ul
WHILE i<6
IF list[i] = target THEN
found<- true
ENDIF
i. i en |
ENDWHILE

a) Complete the trace table for this algorithm. The number of rows does not relate to the
number of steps. [4]

b) The algorithm is currently inefficient. One of the following lines should replace the WHILE
statement above. Identify (tick) the correct replacement. [1]

WHILE found = false

WHILE i<=6 OR found = false

WHILE i<=6 OR found = true al

WHILE i<=6 AND found = false

48 |Practice exam paper 1


9 Below is the start of an algorithm to check when workers arrive and depart from their workplace.
To make the output more user friendly, the programmer wants to make the program accept a
24-hour clock input and translate it into a 12-hour display. Complete the algorithm. [4]

OUTPUT<- “Enter the 24 hour number of arrival”


hour <-USERINPUT

10 A robot is controlled using an algorithm holding four subroutines:

FD (x) moves the robot x squares forward


LT (x) moves the robot x degree left
RT (x) moves the robot x degrees right
Obstacle() is a Boolean control registering TRUE if the way forward is blocked, FALSE otherwise.

a) Draw the path of the robot if it followed these instructions. [2]

START

Practice exam paper 1 49


b) Write the instructions so that the robot is able to follow this path. [2]

A
START

41. A Huffman tree for EVERYONE HAD FUN AT THE PARTY is shown below. Complete the
missing elements in the table below. [3]

Huffman coding

50 |Practice exam paper 1


12 The two tables below form a relational database.

Stock:

Styles

Warehouse:

SpaceUsed
Saa a
aa ee

a) State one field in the Warehouse table which will be the primary key. [1]

b) State how many records there are in the Stock table. [1]

c) Explain how the relationship between the two tables has been created. [2]

Practice exam paper 1 El


13 The black and white image below consists of 36 pixels.

a) Explain why 36 bits are required. [2]

b) State how many bits would be needed if the image had four colours not two. [1]

14 Define the term ‘resolution’. [1]

15 Explain the purpose of an operating system. [2]

16 In binary addition, show the result of 100101 + 10101. Show your working. [2]

52 |Practice exam paper 1


17 Which of the following are common data types handled by most programming languages?
Tick two. [2]
Maximum

Character

While

Length

Boolean
Sp
al
pid
Ke
18 Show the process in bubble sorting in the dataset below. [3]

shapen a re

19 Inabubble sort, tick the maximum number of swaps, if there are five numbers in
the dataset to be sorted. [1]

30 [|
20 What is the worst-case scenario for bubble sort? Explain why. [4]

Practice exam paper 1 |53|


21 Write an algorithm to calculate the average test score in a class of 10. You can use either
pseudocode or a flowchart. [4]

22 State the index of the value 9 in the dataset below. For the purposes of this exercise,
the index starts at [1]. [1]
23,12,4,9,1,30,3

54 |Practice exam paper 1


23 Tick the following statements that are true. [1]
Arrays are of fixed size, so they cannot be edited without rewriting the code.

Arrays allow only sequential access to the data they contain.

Arrays can only store data of one type.


ERA
24 The following code is a function:

FUNCTION HelloWorld (greeting,name)


IF greeting[1] = “Hello”
OUTPUT true
ELSE
OUTPUT false
ENDIF
ENDFUNCTION

a) State the data structure for ‘greeting’. [1]

b) State the data type for the output value. [1]

25 [2]

26 What is a ‘parameter’? Tick one. [1]


A small section of a program laa

A value used to control a function [|

The data sent to a function by the subroutine that called it EB

28 Tick the type of error that will allow the program to run, but will produce an incorrect answer. [1]
Run time error [|

Logic error fint

Syntax error Lae

Practice exam paper 1 55 |


28 Compare the benefits of coding in high-level and low-level programming language.
Your answer should begin with a definition of each type of language. [6]

56 |Practice exam paper 1


405

GCSE

Computer Science

Paper 2 Time: 1 hour 30 minutes

For this paper you must have:

e mathematical instruments

You must not use a calculator.

Instructions

e Use black ink or black ball-point pen. Use pencil only for drawing.
e Answer all the questions.
e Answer the questions in the spaces provided.
e Answer questions that require a coded solution in whichever format you prefer, as long as your
meaning is clear and unambiguous.
e You must not use a calculator.

Information

e The mark for each question is shown in brackets.


e The maximum mark for this paper is 73.
e Remember to use good English and clear presentation in your answers.

Practice exam paper 2 Ey


1 Describe the differences between a ring network and a bus network, highlighting the
advantages and disadvantages of each. [5 marks]

2 Explain the difference between a LAN and a WAN. Give examples of both types of network. [4 marks]

3 Discuss the following statement:

“A wireless network is more convenient, but less secure, than a wired network.”

58 |Practice exam paper 2


4 Complete the following TCP/IP model of the Internet. [3 marks]

APPLICATION LAYER

LAYER

LAYER

(or DATA LINK) LAYER

5 Below there are three network protocols. Tick one which is solely used by email communication. [1 mark]

TCP/IP a
IMAP [|
HTML i
6 Communication across a network is expressed in Mbps. Calculate how many bits are
being transmitted per second for a network with a 5 Mbps connection. [3 marks]

7 Complete the truth table for the following logic circuit: [6 marks]

A
D

K
Zz
B

Practice exam paper 2 59 |


8 Boolean operators are used in embedded systems.

a) State what an ‘embedded system is. [1 mark]

b) Describe one function of the embedded system in a washing machine. [1 mark]

9 Complete the truth table for the AND logic gate. [1 mark]

Ee oe A AND B
aS |aR
FRc Ee
opin] Seer

10 A logic circuit is being developed for a lift door. The door has a sensor each side (A) and (B).
The door opens when one is triggered, and can also be opened or closed using an override
switch (O). The output is shown in Z. Complete the following logic circuit diagram. [3 marks]

B
Zz
O

11. Asmall business wants to explore storing their data in the ‘cloud’. One of their team is worried
about this. Explain the benefits and potential disadvantages of storing data in the cloud.
Your answer should include a clear definition of the ‘cloud’. [6 marks]

|60|Practice exam paper 2


12 Many people resist using files such as MP3 and JPG for their multimedia files.
Explain why this might be. [2 marks]

13 Tick the following statement that is true about run length encoding. [1 mark]

It is most effective on images with many continuous pixels of the same colour [nt]

It is most effective on photographs EE

It produces a lossy format EE

14 One method of data compression is Huffman coding. Here are three types of data.
Tick the type that is compressed using Huffman coding. [1 mark]

Text data lice}

Graphical data [|

Sound data [|

15 Operating systems are an example of which type of software? Tick one. [1 mark]

Application software BB

System software iia

16 Describe what a ‘high-level’ programming language is. Explain why this is preferred by programmers
for some tasks. [3 marks]

17 “Subroutines make the process of algorithm writing easier”. Discuss this statement. [6 marks]

Practice exam paper 2 |61|


18 A patch for an email application is available. Explain why users should always apply patches
for software. [2 marks]

19 What is a data structure? Tick one. [1 mark]

A way of organising data so that it can be used efficiently Fal

A way of organising data so that it is neater fa

A way of organising data so that it is easy to input a

20 Computer systems now manage critical data across our lives. Discuss two ways in which we can
help ensure the safety and security of this data, whether at home, in school or at work. [6 marks]

21 a) State what ‘data validation’ is. [1 mark]

b) Identify two methods of validation. [2 marks]

62 |Practice exam paper 2


22 The statements below are about variables. Tick the statement which is true. [1 mark]

A variable is data stored in memory that can be changed. ia

A variable is data stored in memory that cannot be changed. ia

A variable is created by the computer. ke

23 A software entry screen requires a UK mobile phone number to be entered.


Describe the three types of test data that can be used and give examples of each. [6 marks]

Practice exam paper 2 63 |


> Y) © a] So D
Character Decimal Binary Character Decimal Binary
number number number number
blank space 32 94
3s 95
34
3& o7
36
6 Ve
100
1
67 01
1
02
1
03
1
70 04
1
3 05
1
72 O06
1
73 O7
74 108
és) 109
76 110
tas 114
78 112
79 1 13
1 14
8| 1 15
1
82 16
8) ie
84 118
85 Hg
1
20
87 121
88 ene

|64|ASClltable |
Answers
Module 1: Representing algorithms It starts its search at the middle value (1), then splits the dataset (1)
1. An algorithm is a sequence of steps (1) that can be followed to according to whether the data sought is above or below the middle
complete a task (1). value (1).
This flowchart outputs ‘counting’ (1), then counts sequentially by If the data is unsorted (1) or the value is near the start of the file (1)
1s up to 5 (1) and outputs ‘done’ (1). Binary search (1) because the dataset is sorted (1)
START Linear search (1) because the list is fairly small and not sorted (1).

Module 3: Sorting algorithms


LoopCounter = 0 LoopCounter = LoopCounter + 1 if Av (1)
Yes 2. (6,2,4,1,8) to (2,6,4,1,8)
(2,6,4, 1,8) to (2,4,6, 1,8)
(2,4,6, 1,8) to (2,4,1,6,8)
(2,4,1,6,8) to (2,1,4,6,8)
Is LoopCounter (2,1,4,6,8) to (1,2,4,6,8)
divisible by 3? Total five steps
[4 marks: 1 mark for correct method, 2 marks for correct
sequence, 1 mark for correct number of steps stated]

Output LoopCounter
Yes

ls LoopCounter
<100?

[3 marks: 1 mark for correct split, 1 mark for correct merge,


1 mark for correct answer]
[5 marks: 1 mark for structure, 1 mark for each shape within the
start/stop endings]
Module 4: Data types
The amount of resources it uses in one complete cycle (1). if A Boolean data type has one of two values, generally identified as
The time it takes to complete one complete cycle (1). ‘true’ and ‘false’, or ‘1’ and ‘O’ (1).
Select Program A telephone number would be a string (1) because it is used as an
Select File and Open identifier (1) and is not used as a basis for any calculations (1).
Enter Password In computer science a variable is a location in memory (1) used to
Edit Data store data, it has an identifier (1). The value within this location can
Save and Close change as a result of the processes operated by the program (1).
[5 marks: 1 mark for each entry correctly placed] 5 (1) ;
Iteration is repetition of a process (1). When you declare a constant you also give it a value at the point
Breaking a problem into sub-problems (1), each of which is a task of declaration (1); constants cannot be modified or assigned a
on its own (1). new value without rewriting the code (1). An example would be
Abstraction is the process of removing unnecessary details (1) from DaysInYear = 365, When you declare a variable, you are uniquely
a problem or task such that a computer can process the task (1). identifying (1) a space in memory that will hold a value (1) that can
A trace table works through the program line by line (1) to track the be manipulated by code. An example would be HoursWorked =
variables as they change through the program (1). input(“Hours worked this week: “)
Iteration (1): also Known as repeating a set of instructions a number
Module 2: Searching algorithms of times.
if Calculate mid-point Iteration allows the programmer to code one sequence of steps to be
Compare value to mid-point run through a set number of times (1) to achieve a required outcome,
If >, perform binary search on the left sub-list without having to write that set of steps repeatedly (1). This keeps
If <, perform binary search on the right sub-list [4 marks: 1 mark code shorter (1) and makes it easier to test (1). You may not know
for each step]. how many times code has to run, so cannot physically write it.
A linear search works by looking at every item or set of data in
turn (1) until the details that you are searching for are found Module 5: Pseudocode
(or you fail to find it altogether) (1). if Pseudocode is an informal set of programming language style
Linear search (1) — you can see this because it goes from the first instructions for an algorithm or program (1) that is designed to be
item in the array. easily read and doesn't use any specific syntax (1).
It is called brute force searching because it goes through each item
without prioritising them, one by one, until it reaches the data sought (1).

Answers 65 |
2. Input student mark Module 8: Data structures
If student mark > 30
print ‘passed’
Else (1)
print ‘did not pass’
End (1)
3. Counts (1) and prints (1) numbers up to 100 (1). 2. Data structures define how data is formatted and stored (1) to
4. Prints all numbers between a user-set start and finish point allow for efficient search, retrieval and processing (1).
(1), printing an error message (1) if the start number is larger Output would be “pears” (1) because all lists are indexed
»
than the finish number (1). starting at O (1).
5. Input Numberl No (1) because arrays do not accept mixed data types (1).
Input Number2 The array has 6x6 elements (1) — 36 in total (1).
Input Number3 (1) 6 is the 5th item (1) because all indexes start at 0.
Sum = Number1+Number2+Number3 NOS
An array is static in that its size is fixed and cannot be
print “The sum of the numbers is: “ + “Sum (1) updated (1).
Product = Number1*Number2*Number3”
print “The product of the numbers is: “ + Module 9: Input/output and file handling
“Product” (1) 1. It would open a csv file (1) called contacts (1). It then asks
the user to input their name and phone number (1) and then
Module 6: Arithmetic, relational and Boolean operators in saves the new data to the file (1).
programming languages 2. External sensors (1), e.g. temperature, movement or sound.
1. Inputa User input (1), e.g. keyboard, mouse, touchscreen.
input b 3. An index allows the computer to search the database more
crab effectively (1), because it is possible to search the index (1)
print c (1) rather than the whole database to locate the element sought.
2. Code 1 would show the integer value of 13/2, which is 7 (1). 4. Because the computer cannot check if you are telling the
Code 2 would show the ‘real’ or ‘float’ value, which is 6.5 (1). truth (1) — only that the data you enter is within the limits that
The integer value is the rounded up whole number result of have been set (1).
the calculation (1). 5. file = open(“classlist.csv”, “a”)
3. Because you cannot use mathematical operators on strings like name (1) = input (“Please enter name.”)
‘Name’: you can only use mathematical operators on numbers (1). file.write (1) (name + °,”+ ™\n”)
4. The coder used division (/) on the calculation of pay based 6. The file would be overwritten everyday, meaning older
on hours worked and pay rate (1). This should have been a * versions could not be accessed (1). A solution would be to
for multiplication (1). create a daily backup with an alternative filename (1).
5. Although b has a value lower than 50, a is greater than 10 (1),
so the printout would be ‘Extra Homework!” (1). Module 10: String handling
6. bstill has the lower value, but now the code is looking for 1. Astring data type can contain any alphanumeric character
a being equal to or greater than 10 (1). So now the display (1), including punctuation (1).
shows “Class Dismissed!” (1).
Store as an Store as
integer a _
Module 7: Flowcharts
1. a= decision (1)
b = terminator (START/STOP) (1)
c = input/output (1)
d = process (1)
2. When an input value is entered, the flowchart checks if it
is greater than or equal to 10 (1). If it is not, the “Outside
acceptable range” statement is given and resets (1). If it is,
the flowchart checks if it is also equal to or less than 20 (1).
If not, it resets again and if it is, the final “Acceptable range” [4 marks if fully correct, 3 marks if four correct, 2 marks
message is given and the flowchart stops (1). if three correct, 1 mark if one correct]
3. “fishchipsmushy peas” (1) because there is no clear space
set up between the strings (1).
4. 102 (1)
5. So that the computer can distinguish between the two
READ TEMPERATURE
possible data entries, as in passwords, for example (1).

Module 11: Random number generation ina


PRINT “TEMP programming language
FINE!" 4. Arandom number is generated by a process with an
outcome that cannot be predicted or reproduced (1). A
pseudorandom number is a computer-generated random
number that appears to have the same properties but is

Answers
created using statistical patierns that can be repeated and
PRINT “CLOSE
therefore it is not truly random (1).
WINDOWS!"

(2)

|66|Answers
ra Any two from: user ID generation; online gambling; computer Module 14: Parameters and subroutines
games; online password generators; cryptography services. 1. Any one from: name; value (1).
[2 marks: 1 mark for each use] 2. Any two from: the code can be written once, then used more than
It chooses a random integer (1) of value between 1 and 100 once, as needed, such as a greenhouse temperature monitoring
(1), and encourages the users to guess the number. It counts system; keeps code shorter because you are only writing the code
the number of guesses and outputs that number as part of the once for the subroutine, no matter how many times you need it,
message (1) when the user gets the number right. The random your code overall can be considerably shorter; easier to test even
function in this code ensures that truly no one knows in advance the large tasks, if decomposed into smaller subtasks, can be easy to
value of the number to be guessed (1). test one module — or subroutine — at a time; you can access and
use any variable from your main code without having to redefine it.
Module 12: Databases [2 marks: 1 mark for each example]
1 A flat-file database has only one table (1), such as an Excel 3. Accept an answer such as:
worksheet which shows the prices of products in a store (1). Sub ImageCheck (1)
A relational database has several different tables linked together maxFileSize = 1 (1)
(1), such as a school database that contains details of students, input “file to be uploaded” (1)
staff, classes (1). Check file properties (1)
A primary key is a data entry uniquely identified to each record IF filesize <= max
within the database (1). UPLOAD file
Structured data is data organised into a specific format (1), such ELSE
as your contacts on your phone (1). Unstructured data is like a list output “file too large” (1)
of your IMs or the contents of your social media photo account (1): ENDIF
there is no coherent organisation (1). EndSub (1)
To output the data in a way that is easy for humans to read (1). 4. (a)

ere ()
®p mana: mar
©
D
: 4mare:
correct row]

Module 13: Introduction to subroutines and structured


programming
if Any three from: clearly breaking a big task into little ones makes START (1)
the big task more achievable; using self-contained code modules
(b)
or subroutines (one for each part of the task) makes it easy to see
which part of the code does which part of the overall task; updates
are a lot easier — you just change the bit that needs to be updated;
can be called from the main program, or another subroutine.
[3 marks: 1 mark for each correct example]
A comment is an annotation of the code only relevant to the human
reader — the computer overlooks it. It helps the human reader see
what is supposed to happen, and is identified using a convention
(1) such as #Total The Amount in this section (1).
Assembler (1): A program that translates assembly language into
machine code (1).
Compiler (1): A program that translates high-level programmer
written code into low-level machine code (1).
Interpreter (1): A program that translates programmer code line by
START (1)
line (1) into machine code.
(c) Accept answers such as:
4. 1. Comments in the code (1)
FD)
2. Clear variable names (1)
3. Modules and functions appropriately named (1)
4. Use indented code where available (1)

Answers }67|
————
Module 15: Robust and secure programming the non-Western languages that ASCII doesn’t recognise or
1. Validation ensures that the data is within reasonable limits accommodate (1). Unicode has separate character sets for
(1), such as a date of birth, or a postcode (1). It does not test the majority of written languages across the globe.
whether the data is actually true (1).
Verification checks whether the data is true (1), and this is Module 18: Representing images and sound
generally a human task (1) rather than a computer one. Date ile The program takes a number of samples of the sound at
of birth, for example, can be confirmed with a birth certificate regular set intervals (1), and works out the ‘top’ and ‘bottom’
or driver's licence or passport (1). values of the analogue sound within each sample (1). If the
Accept answers such as: sound being processed is ‘above’ the halfway point, the
Make some answers ‘required’ so that they can rank against program checks again if the sound would still be above
them. halfway if the first half was cut into half again, and so on.
Ask for the same information in different ways so that if the ‘Above’ is recorded as a ‘1’, ‘below’ it is recorded as a ‘0’ (1).
answers differ then something isn't right. The more samples per second that are taken, the higher the
[2 marks: 1 mark for method, 1 mark for description] quality of sound — and the larger the file (1).
Accept answers such as: Bit depth is the number of bits available for each sample
Timeln >= 0700 AND Timeln < 1200. ‘nine o'clock’ would be taken from the sound (1). The greater the bit depth, the better
invalid. the quality of sound (1).
[2 marks if fully correct, 1 mark for valid time control] MP3 is a lossy compression format so a lot of data is lost in
Any two from: making sure the program runs without errors; the compression, thus reducing the size.
testing confirms that the product that has been created to meet or
the original specification criteria or problem; mimicking user WAV is a lossless compression format so very little data is lost
input with different data to make sure all possible values are in compression, meaning that the file size isn’t reduced as
dealt with appropriately; eliminating the need to withdraw and substantially.
re-release a program. [2 marks: 1 mark for description, 1 mark for explanation]
[2 marks: 1 mark for each point made] Resolution refers to how many pixels are used per square (1).
Normal: e.g. 01/10/1974 (1) Low-resolution graphics are coarser (1) and may seem ‘furry’;
Extreme: 01/01/2000 or 31/12/1999 (1) high resolution graphics have more pixels per square (1) and
Erroneous: e.g. 5" June 1969 (1) therefore are clearer and sharper (1).
JPEGs allow compression of graphics in a lossy format,
Module 16: Number bases and binary arithmetic meaning that data quality is lost (1) as the file is increasingly
ut It is easier to translate into decimal (1), easier to understand compressed (1), but JPEGs can also be saved in full
(1). Each hexadecimal digit represents 4 bits, or a nibble, so uncompressed detail (1).
two hexadecimal digits represent a byte (1). A pixel is short for Picture Element, and is a single ‘dot’ on
A= OG weeee your screen or printout (1). It is a square of one colour used to
160 + 2=162 [2 marks: 1 mark for correct working, 1 mark make a bitmap image (1).
for correct answer]
00000111 Module 19: Data compression
+ 00000111 if A Huffman tree shows the frequency of elements in a file, coding
00001110 the most frequent ones with the smallest number (1), to limit
[2 marks: 1 mark for correct working, 1 mark for correct the file size overall in a lossless compression strategy (1).
answer] RLE is a very simple form of lossless data compression (1)
Ge ae alee which converts consecutive identical elements by storing the
= 200mlOmmal number of identical elements as a code (1).
= 4 ORO When it is used on images that have many continuous
= (018, identical colour pixels black and white image, for example (1).
[2 marks: 1 mark for correct working, 1 mark for correct
answer]

Module 17: Units of information and character encoding


i (a) 8 (1)
(b) 256 (1)
(c) 2048 (1)
Any one from: 1 coded as black and 0 as white; 1 as white
and 0 as black (1).
Mo A nibble (1)
= A gigabyte (GB) is 1024 megabytes (1).
A terabyte (TB) is 1024 gigabytes (1).
There are 16 possible binary numbers (1), so 16 possible
[5 marks: 1 mark for each correct element]
codes may be actioned (1).
256 colours (1)
Module 20: Hardware, software and Boolean logic
Colour depth is used to describe the maximum number of
colours that could be used in the graphic (1). The higher the iP Any two from: defragmentation software moves file blocks
closer together; so that the computer can load files more
number of colours then the more complex the colour palette —
quickly; compression software reduces file sizes using less

Answers
and the larger the file size (1).
space so that the files may be loaded more quickly; some :
The original 128 characters within ASCII are not sufficient
type of backup software could be used to move files to a
to represent all of the possible characters, numbers and
secure place, then the user could delete the less often used ~
a
symbols in languages across the world (1). Unicode includes ~' %
~
files on the hard disc to free up space; which would improve the Module 23: Secondary storage
speed of the disc. [2 marks: 1 mark for each correct example] if Optical (1). CD/DVD/Blu-ray (1)
2. Busv (1) 2 A ‘-R' disc can only be written to once (1) whereas a ‘RW’ disc can
3. Hardware is the collective name given to the physical (or electrical) be erased and re-written multiple times (1).
components (or parts) of a computer system (1). <F You can come to either conclusion — that cloud storage is a good
4. RAM memory is the workspace of the computer. If there isn't enough or not-so-good option for the organisation. Your comments should
capacity in memory for the CPU needs, the computer has to set up include elements such as:
what's known as a virtual memory file (1). To do this the CPU reserves
Advantages of cloud Disadvantages of cloud
space on the hard disk to simulate (or pretend to be) additional RAM.
storage storage
This process, referred to as ‘swapping’, slows the system down (1).
Access from anywhere with You need a reliable Internet
AORB | Internet connection. connection — especially if
So if they have travelling you are handling large files.

ae" representatives they can So if they have travelling

oe
access files and update representatives they might
1 diaries, for example. be trying to access diaries
or online files and find that
they cannot.
[2 marks if fully correct, 1 mark for the first two lines]
6. Two colours are needed so only two possible bit patterns — For businesses, this means You are relying on someone
that offices across the world else to keep your files safe.
which can be represented with one bit showing either
can access the same files.
O or 1 (1): therefore 25 pixels will need 25 bits (1).
Disaster recovery is easier — Moving from one provider to
Module 21: Software classification assuming that your storage another can be difficult.
1. Any one from: word processing; spreadsheet; desktop publishing (1). provider wasn't affected by So you need to be sure that
whatever hit your system. they meet the standards
It is not enough to simply name a product like ‘Keynote’ or ‘Word’,
So if the organisation is you need as a small
2. Anti-virus checker v (1) holding staff and customer organisation.
3. Open source software is provided with a licence that means it data it is easier to recover
can be downloaded, along with its source code, used, edited or without imposing on the
redistributed for any purpose (1). people.
4. ACommand Line Interface is the text based way of communicating
Costs are generally lower There can be data
with the computer (1). It is not particularly efficient nor is it user
per MB and storage capacity ownership issues if your
friendly (1). A Graphical User Interface is the basis of most systems is more flexible than local provider is sold to another
today, like iOS, WindowsX and MacOSx, where icons replace the storage. company — when Facebook
words (1) and a mouse is used more than a keyboard (1). So this can be a better idea bought Instagram,
5. The OS is needed to provide an interface between application for a small organisation that is all Instagram content
software/user and hardware (1) and to handle input/output devices balancing costs carefully. transferred a ‘licence to use’
that content to Facebook
(1). It is responsible for memory management (1) and for allocating
— without users’ express
processor time (1). It also provides security (1). consent.
6. A device driver is a small program or software interface (1) that So the data they hold might
enables an operating system to communicate with a hardware well be given away to a
device (1) such as a printer or graphics card. bigger company, breaking
the law. They need to be
sure that this is not going to
Module 22: Systems architecture
happen.
1. Volatile memory (such as Read Access Memory) (1) will only hold
data in memory as long as there is a power source, whereas non- [8 marks: 0-2 marks — A poor response containing little
volatile memory (such as USB storage) (1) will Keep contents when explanation of advantages and disadvantages. No use of
power is disconnected (1). technical language and poor use of spelling and grammar;
2. A Von Neumann bottleneck occurs when an ‘instruction fetch’ and 3-5 marks — A response is given that relates to the scenario.
‘data operation’ cannot occur at the same time because they use Some advantages and disadvantages are given with some
the same bus (1). explanation. Some examples are provided and there is some
3. The fetch-execute cycle is the process by which the CPU reads use of technical language. Only minor errors in spelling and
(fetches) instructions from the memory cache, decodes them, and grammar; 6-8 marks — A detailed response is given that is
then operates — or executes — the instruction (1). related to the scenario. Advantages and disadvantages are
4. RAM loses its content when the power is switched off (1) and ROM given and explained fully. There is a balanced discussion and
is read-only so cannot be edited (1). all examples are relevant and appropriate. There are few, if any,
5. Level 1 cache Vv (1) errors in spelling and grammar.]
6. Virtual memory is a section of the hard drive that is used when the 4. An embedded system is one in which the computer system plays a
computer does not have access to enough RAM to complete the part ina much bigger device. The computer element is often nearly
tasks in the program (1). invisible, but essential (1). Examples include digital watches/MP3
7. The computer uses cache memory as a form of buffer because players/traffic lights (1).
the CPU works faster than RAM (1). The data is pushed into cache
memory before the CPU needs it to stop the slower memory
inhibiting the function of the CPU (1).
8. Buses are wires around the motherboard that connect the
components that are attached (1).
9. The number of cores (1) and the cache memory (1).

Answers |69|
5. Any two from: solid state media can be more compact than Module 25: Network topology
magnetic media: the smaller size enables better portability; iti A star network topology has one connection to each of the
the battery will last longer because solid state media uses resources or devices on it (1), while a mesh network connects
less power; speed of access is higher in solid state drives so every device to every other device (1). While the mesh network
you can more quickly access your data; solid state is silent, is more robust (1), it is also a lot more expensive. (1)
so it can be used in a wider variety of settings. Example answer:
[4 marks: 2 marks for each reason]

Module 24: Definitions and types of networks

S$ @
it A network often based on Bluetooth connection between
devices such as keyboards, pointing devices, phones, audio
headsets and printers (1). These cover very short distances
(up to about 10 metres) but have the advantage that they can
move with the user (1).
A LAN is a network in which all connected devices are
s
relatively close together, in a single building or premises
(1) like a school or office complex (1). A WAN is a network
in which the connected devices are too thinly spread to S-

make a physical connection (1) and is used by multinational


Network cable between
organisations and even the Internet could be described as a
each component
WAN (1).
[5 marks: 1 mark per element. Must include network cable
Wireless (1). Suitable if they use their laptops in a portable
and clear indication of the comms between devices and
manner (e.g. hot desking) (1), if they all work in a relatively
the ID of the devices]
small area and can rely on appropriate WAP points (1), if their
Each device has its own MAC address (1). If the firewall has
network connection is secure (i.e. password protected) (1)
a list of those authorised to use the network resources, the
and if there isn't a lot of heavy traffic (e.g. video streaming)
MAC address of a new device can be checked against that
across the network (1).
whitelist (1): if it isn't there the network is sealed against that
You can argue for either point of view, just make sure you
device (1).
include evidence such as:
A whitelist identifies authorised sites if on an Internet filter, or
Allowing wireless connectivity means:
users or machines if on a firewall. Only those on the whitelist
e it allows students to make use of their own portable
are allowed through. A blacklist bars only those devices or
devices in their learning;
addresses identified on the list (1). A whitelist is more secure
e maintaining a safe learning environment is very important
(1), but a blacklist is more flexible (1), since the whitelist
as students are more vulnerable to safety issues (like
provides an absolute and limited list of devices or sites which
trailing wires);
are allowed, while the blacklist just blocks the resources or
e it allows computing devices to be used outside of the
sites identified (1).
lesson, e.g. in PE or drama;
Each packet of data has to travel through all of the devices
¢ schools have limited budgets and it is cheaper to add
between its origin and its destination (1). If one device
extra wireless devices to a school network;
malfunctions the whole network is compromised (1).
e less cable and drilling are needed when expanding the
network and this may save money;
Module 26: Communication protocols
e there are now many devices which don't have wired
connection ports and schools/students may want to be
able to use these devices.
And barring wireless connectivity means:
¢ wired networks can provide high bandwidth for when
students make use of a lot of multimedia;
e schools need high bandwidth / reliable systems as delays
in lessons are not acceptable;
e there is better security on wired networks, making it
easier for schools to control/monitor how students are
using the network;
[4 marks: 1 mark for each layer]
¢ network performance may be poor if there are large
The Transport Layer sets up the communication between
numbers of student-owned devices using the school the sender and the destination, making sure they agree the
network at any one time. ‘language’ and also that the recipient knows the size and
[8 marks: 0-2 marks — A poor response containing number of packets that it should expect (1). If any go astray
little justification for the argument. No use of technical the Transport Layer automatically tries a number of times to
language and poor use of spelling and grammar; 3-5 re-send before transmitting a ‘failed’ message to the original
marks — A response is given that relates to the scenario.
sender so that they know the message went astray (1).
Some justification for the argument. Some examples are Protocols are a set of communication standards (1) that
provided and there is some use of technical language.
govern transfer of data between devices (1).
Only minor errors in spelling and grammar; 6-8 marks —A
detailed response is given that is related to the scenario.

Answers
Detailed justification for the argument. There is a balanced
discussion and all examples are relevant and appropriate.
There are few, if any, errors in spelling and grammar.]

Answers .
11. Browser and operating system, driver and application software, are

Starting handshake
Displaying HTML pages v
rata regularly updated (1) to ensure robustness and security (1) —and
malware writers are constantly benefitting from those who delay
their updating (1). A loophole/error/back entrance may have been
found that puts the computer at risk (1).

[3 marks: 1 mark for each tick]


Module 28: Detecting and preventing threats
This model spreads the workload between the main server and the
1. Encryption is the process of changing information or data (1) into a
user's device (1): a client device may share resources with the more
form that may only be understood by a recipient who has the key to
powerful server, which enables faster communication because the
decrypt it (1).
server does the work before transmission (1).
Encoding is a way of changing information into data that the
6. The application layer is the top-most layer and it includes protocols
computer can process (1) such as changing ‘Male or Female’ into
like DNS, HTTP(s), SMTP, IMAP, SSH, FTP (1). This controls how
‘M or F' (1).
applications access data and communicate (1).
Encryption on the other hand makes the message impossible to
understand by anyone who does not have the key (1) such as the
Module 27: Definition, purpose and threat
enigma machine in WWII (1).
us A Trojan horse is a malicious computer program (1) that appears to
1. Online communication of personal data has to be encrypted to
the user to be of legitimate use but actually causes damage to the
be safe.
computer it is installed on (1).
2. Governments use online secure data to transmit messages to
Accept answers such as:
outlying offices and embassies.
Uses a range of characters, ideally including punctuation.
3. Online commerce needs customers to be able to securely
More than 8 characters long.
transmit payment details.
Not based on a word.
4. Online banking requires that account holders can access their
Not based on any easily known personal information (pet name,
accounts Safely.
post code...).
[4 marks: 1 mark for each reason]
Easily remembered so not written down.
Secure (1)
Regularly (and frequently) changed.
A private key is a very small code (1) used by anyone to encrypt
Not used more than once.
messages (1) intended for a particular recipient, ensuring that the
[4 marks: 1 mark for each example]
encrypted messages can be decrypted only by using a second key
Emails can be intercepted (1) so should never include sensitive
(1) that is known only to the recipient (1).
material (1). It might not be you asking for the password information
While a ‘white box’ penetration test simulates an attack (1) by a
(1), so this might be unauthorised access (1).
malicious insider who knows something of the computer system
Adware is advertisements which are included in the software
under attack (1), a ‘black box’ test simulates external hacking (1) or
program and are displayed at intervals during use (1). Could be
cyber warfare (1).
dangerous, you don’t know what is included, or who has built it, and
Advantages — any two from: cheapest security system of all; if
it may include cookies and/or spyware (1).
frequently changed, passwords can be among the most secure
Any three from: fraudulently obtaining information by claiming to be
access devices; no specialist hardware required.
a reputable organisation; pretending to be a bank and requesting
Disadvantages — any two from: people forget them; vulnerable
login details; emailing a user to update personal details via a false
to brute force attacks and keyloggers; depend on users using a
website; creating false versions of existing websites. [3 marks:
secure combination — and only once for each login. [4 marks:
1 mark for each point made] 2 marks for two advantages, 2 marks for two disadvantages]
Social engineering attempts to trick a user into revealing their
CAPTCHA is supposed to identify human access to the site (1) as
password (1) and other security information through ruses such opposed to automated computer access (1).
as pretending to be a new employee, or a colleague from another Any two from: can be difficult to read — especially for people with
branch, or someone begging you for help (1). Humans generally visual impairments; some browsers don’t render them accurately ;
want to trust other humans, and since most of the time the request not popular with users; audio version isn’t always clear enough to
is genuine this is a hard one to beat. Asking to contact them back understand; requires a keyboard so not entirely user friendly.
on an organisation phone extension can be one method of defence [2 marks: 1 mark for each disadvantage]
(1), since email addresses can easily be faked (1). 10. (a) This is a term used in computer security to refer to the use of
Malware can deliberately encrypt data, delete or corrupt data, physical characteristics (1) which are unique to each person
destroy hard drives (1), and generally cause considerable harm as a password or security element (1), such as fingerprints or
and distress (1). retinal scans (1).
To control the access different users have to information ¥ (1) (b) Passwords are often forgotten (1).
This is when a site is attacked by a number of systems causing Passwords are often easily hacked (1).
the server to shut down access to legitimate users or even entirely Biometrics are unique to each person (1).
shut down (1). A strategy for the attacker is to compromise one You can't forget a biometric — it’s your finger or eye scan (1).
computer and take over its access to the Internet, then use it to
infect others with malware that allows them to be controlled also (1).
A computer under the control of an attacker is known as a ‘zombie’
or ‘bot’ (1), and botnets (collections of these hijacked computers)
are often considered one of the biggest current threats to Internet
security (1).
10 Allowing accounts to remain of people who have left the
organisation, or allowing anyone to self-register, means that the
network is open to any type of abuse (1) — witting or unwitting.
No one who does not have the right to access should have that
access. No one should have more access to network resources
than they absolutely need (1).
Module 29: Ethics provided and there is some use of technical language.
if, Answers to include: Only minor errors in spelling and grammar; 5—6 marks —A
¢ Definition of the right to be forgotten — that individuals detailed response is given that is related to the scenario.
have the right —under certain conditions — to ask. Detailed justification for the argument. There is a balanced
e Search engines to remove links with personal information discussion and all examples are relevant and appropriate.
about them. There are few, if any, errors in spelling and grammar.]
e Current news about people who have been reported as Answers to include elements such as:
using this right (such as Mario Costeja Gonzalez, who e Data should be fairly and lawfully processed.
provided the test case). ¢ Data should only be used or disclosed for the specified
e Clearly supported reasoning behind opinion, e.g. notified purposes.
e Innocent people shouldn't have to drag around e Data should be adequate, relevant and not excessive.
incorrect online stories e Data should be accurate and kept up to date.
e The Internet doesn't forget e Data should not be kept any longer than necessary.
e |nternet searches help check on prospective e Access must be provided for individuals to check and
employees or partners correct their data, with a right of explanation when a
[6 marks: 0-2 marks — A poor response containing computer takes automated decisions based on the data.
little justification for the argument. No use of technical e Data should not be transferred outside the European
language and poor use of spelling and grammar; 3-4 Union except to countries with adequate data protection
marks — A response is given that relates to the scenario. legislation.
Some justification for the argument. Some examples are [6 marks: 0-2 marks — A poor response containing
provided and there is some use of technical language. little justification for the argument. No use of technical
Only minor errors in spelling and grammar; 5-6 marks —A language and poor use of spelling and grammar; 3—4
detailed response is given that is related to the scenario. marks — A response is given that relates to the scenario.
Detailed justification for the argument. There is a balanced Some justification for the argument. Some examples are
discussion and all examples are relevant and appropriate. provided and there is some use of technical language.
There are few, if any, errors in spelling and grammar.] Only minor errors in spelling and grammar; 5-6 marks —A
Define Internet of Things: the network of physical objects or detailed response is given that is related to the scenario.
‘things’ embedded with electronics, software, sensors, and Detailed justification for the argument. There is a balanced
connectivity to the Internet. discussion and all examples are relevant and appropriate.
Argument (positive or negative) including evidence such as: There are few, if any, errors in spelling and grammar.]
¢ Asmart home helps people who are disabled live a more
‘normal’ or mainstream life. Module 30: Encryption
e When computers monitor presence in a home and can be i This is a simple ‘shift’ cipher, whereby each letter represents
hacked — is this a privacy concern? another in a logical sequence (1).
e lf your fridge can keep a watch and report to your doctor GCSE COMPUTER SCIENCE (1)
on how much chocolate you eat — does this erode your Hashing is used to check whether anyone has tried to break
individual rights to eat what you choose? the code before sending it on. Any changes to anything in the
e lf your phone can check your heart rate if you are at risk content will produce a garbled or changed message when
of a heart attack, or it can check if you're about to suffer the legitimate key is used (1).
an epileptic fit— doesn’t that reassure you and your Plaintext is an unencrypted message (1).
family? Encrypted data is deliberately scrambled so that it cannot be
[6 marks: 0-2 marks — A poor response containing understood straight off (1). The unauthorised person would
little justification for the argument. No use of technical not have the key to decrypt the data (1).
language and poor use of spelling and grammar; 3-4 Answers to include:
marks — A response is given that relates to the scenario. E-commerce
Some justification for the argument. Some examples are Online banking
provided and there is some use of technical language. Secure messaging
Only minor errors in spelling and grammar; 5-6 marks —A Government business
detailed response is given that is related to the scenario. [2 marks: 1 mark for each use identified]
Detailed justification for the argument. There is a balanced SSL stands for ‘secure sockets layer’, a protocol that uses a
discussion and all examples are relevant and appropriate. key to encrypt data (1) across the Internet using two keys:
There are few, if any, errors in spelling and grammar.] a public key accessible to all and a private key known only
Answers to include elements such as: to the recipient of the message (1). This combination is the
e The owner of the servers might be bought out or go only way in which secure communication is possible (1). Your
bankrupt: what happens to your data? browser connects to the website and requests an identity
e The servers might be hacked. check from the server, to make sure that the server sends a
e The legal framework might change of the country where recognised SSL certificate. If this is part of a list the browser
the data is stored — e.g. ‘safe harbor’ rules of the US and holds, then all is well. If not, the browser will ask the user ‘Are
the 2015 EU decision to not accept this. you sure you want to deal with the owners of this website? |
e Online storage allows data files to be accessed from don't know them!’ At this point it is a good idea to pause and
anywhere with online access. check you have typed the correct URL, because this is a
e Online storage allows collaboration between colleagues hint that something isn’t necessarily right. If the certificate is
on one file. recognised, the URL changes from HTTP to HTTPS and you

Answers
[6 marks: 0-2 marks — A poor response containing can continue your session in an encrypted mode (1).
little justification for the argument. No use of technical
language and poor use of spelling and grammar; 3-4
marks — A response is given that relates to the scenario.
Some justification for the argument. Some examples are

Answers ?
Paper 1 b) FD (3)
A (1) LT (90)
2. 1111101 (1) FD (2)
3. cache v (1) RT (90)
4. a) A Caesar cipher is a set of alphabetical letters set against a FD (2)
second set, but ‘shifted’ a set number of places so that each LT (90)
letter is paired against a different one in the opposing set FD (2) (2)
(1). When a message is encoded, the coded letters (not the iA Character | Huffman coding
original message) are sent to the recipient, who can decode the SPACE 111
message only if they know the ‘shift’ (1). N 00011

retolmtrlulrterats|
b) [P{[B[z[clH]{G|
tutste
001
[3 marks: 1 mark for each correct row]
Perera EM Lents a Pipe pest [ee 12. a) WarehouseLocation (1)
[BI IIN/ATR{[Y{ | ae pica 5 (1)
[3 marks: 1 mark for each correct word decoded] c) The primary key (1) from Warehouse is a field in the Stock table (1).
5. a) Aclient-server model spreads the workload between the main 13. Each bit can hold two colours (1) — 36 pixels in a two-colour
server and the user's device (1). image need 36 bits (1).
b) Aclient device may share resources with the more powerful b) 2 per pixel (1)
server (1), which enables faster communication because the 14 . Resolution is the number of pixels per set size, e.g. per inch, not in
server does the work before transmission (1). the overall image (1).
6. Hexadecimal is easier for humans to read Vv (1) . An operating system manages the computer resources and is
7. 58,34,2,4,39,54,1 = starting the interface between the user and the computer (1). It controls
34,58 24 5439 1 memory and processing time, manages access rights of users and
2,4 34,58 39,54,1 handles errors (1).
1,2,4,34,39,54,58 = finishing 100101
[2 marks: 1 mark for correct steps, 1 mark for correct outcome] + 10101
8. a) 111010
[2 marks: 1 mark for correct working and 1 mark for correct answer]
Character ¥ (1)
pats =| Boolean Vv (1)
greta2) - 16,21,11,19 -> 16,11,19,21 -> 11,16,19,21 [3 marks: 1 mark for
each stage. Mark for last stage will only be awarded when the
ae other stages are correct]
et . 10v (1)
[4 marks: 1 mark for each correct column] . The worst situation for bubble sort is when the list is effectively in
b) WHILE i<=6 AND found = false Vv (1) reversed order, so that every element (1) is in the ‘wrong’ position (1)
9. Example answer: and must be moved on each pass so that the sort will need to make
IF hour = 0 THEN the maximum number of passes (1) through the list.
OUTPUT 12 21. Example answers:
OUTPUT ‘am’ Set total to zero
ELSE IF hour < 12 THEN Set SCOre™ counter Co one
OUTPUT hour While score counter is less than or equal to ten
OUTPUT ‘am’ Input the next score
ELSE IF hour = 12 THEN Add the score into the total
OUTPUT 12 Set the class average to the total divided by ten
OUTPUT ‘pm’ Print the class average.
ELSE hour < hour - 12
OUTPUT hour
OUTPUT ‘pm’
ENDIF
Total = 0
ENDIF
ENDIF (4)
10. a) FD (3)
LT (90)
FD (3)
RT (90)
FD (1) AVERAGE =
TOTAL 10

Yes
OUTPUT
INPUT NEXT AVERAGE
SCORE
START (2)
ADD SCORE TO
TOTAL
[4 marks: 1 mark for right sequence, 1 mark for loop, 1 mark for
accurate calculation, 1 mark for output]

Answers
22. Position (or index) 4 (1) Paper 2
23. Arrays are of fixed size, so they cannot be edited without 1. Answers to include:
rewriting the code. 4 A bus network has a central spine of network cabling
Arrays can only store data of one type. Y [1 mark: both (called a bus) while a ring network has all of the computers
correct for 1 mark] connected to each other in a circle.
24. Array (1) A bus network is simple and cheapest to install and is good
Boolean (1) for a temporary network. It is flexible because elements can
25. Any two from: to make code easier to read; to allow for code be removed or added without messing with the rest of the
reuse/sharing; to improve code maintenance/make the code network. It is best used in small or temporary networks and
easier to update; to reduce programmer error. [2 marks: can be a useful home network solution. A ring network can
1 mark for each answer] offer fast data flow when it is working well — all data flows in
26. The data sent to a function by the subroutine that called it ¥ (1) one direction. Even when the load is the same, this performs
27. Logic error ¥ (1) better than a bus setup. Each device can access the
28. Answers to include: resources on the network equally.
High-level languages are human readable, but must be Both have disadvantages, however. In a bus network, if the
compiled or interpreted to be processed by the computer. bus (spine) fails the whole network crashes. Performance is
Low-level languages are closer to machine code, but are affected by load so the more devices attached, the slower
hard for humans to read. it functions. Bus cables are limited in length, so the network
If you write in a low-level language you have much more is limited in size, and must be terminated properly to avoid
control over the performance of the code and processor, reflection of signal, which can crash the system. Data has
while in a high-level language you are dependent on the to ‘queue’ sometimes because the bus is busy with other
compiler. If you write in a high-level language you can more demands. |n a ring network, each packet of data has to
easily debug an error track it, since it is easier for humans travel through all of the devices between its origin and its
to read. destination. If one device malfunctions the whole network is
Low-level languages take longer to write and check compromised. Setting this up is more expensive than a bus
than high-level languages, but writing code in high-level network. [5 marks: 1 mark for each correct point made]
languages loses some of the time benefit because the code A LAN is a network in which all connected devices are
must be compiled. relatively close together (1), in a single building or premises,
Low-level languages are harder for humans to learn than like a school or office complex (1). A WAN, on the other hand,
high-level languages. is a network in which the connected devices are too thinly
[6 marks: 1-2 marks: There are a few simple or vague spread to make a physical connection (1). These tend to be
statements relating to the question.The form and style of connected through telephone lines, undersea cables and, in
writing has many deficiencies. Ideas are not often clearly extreme cases, satellite links (1).
expressed. Sentences and paragraphs are often not well- Answers to include:
connected or at times bullet points may have been used. A wired network offers a more reliable connection because
Specialist vocabulary has been used inappropriately or not the link is physical. This means that it is also usually faster
at all. Much of the text is legible and some of the meaning than wireless connections. It is less convenient because it ties
is clear. There are many errors of spelling, punctuation the device to one place, but because the data is transferred
and grammar but it should still be possible to understand through a physical link it is more secure.
much of the response. 3—4 marks: There is evidence A wireless network allows more freedom of movement,
of some evaluation shown through the use of mostly although you can lose signal under less than ideal conditions.
correct technical explanation linked with advantages in Sharing a wireless access point with other users can also
the situation given. The answer covers a few of the ideas slow the speed of any data transfer. Security can be an issue
above or includes other correct answers. The form and since data is broadcast rather than contained within a cable.
style of writing is appropriate to the purpose and some [6 marks: 1-2 marks: There are a few simple or vague
complex ideas are expressed reasonably clearly and statements relating to the question. The form and style
fluently. Well linked sentences and paragraphs are usually of writing has many deficiencies. Ideas are not often
used. Specialist vocabulary has been used on a number clearly expressed. Sentences and paragraphs are
of occasions but not always appropriately. Text is legible often not well-connected or at times bullet points may
and most of the meaning is clear. There are occasional have been used. Specialist vocabulary has been used
errors of spelling, punctuation and grammar. 5-6 marks: inappropriately or not at all. Much of the text is legible and
There is evidence of a clear evaluation shown by a correct some of the meaning is clear. There are many errors of
explanation and three well justified comments. The answer spelling, punctuation and grammar but it should still be
covers most of the ideas above or includes other correct possible to understand much of the response. 3-4 marks:
answers. The form and style of writing is appropriate to There is evidence of some evaluation shown through the
the purpose and complex ideas are expressed clearly and use of mostly correct technical explanation linked with
fluently. Sentences and paragraphs follow on from one advantages in the situation given. The answer covers a
another clearly and coherently. Specialist vocabulary has few of the ideas above or includes other correct answers.
been used appropriately throughout. Text is legible and the The form and style of writing is appropriate to the purpose
meaning is clear. There are few, if any, errors of spelling, and some complex ideas are expressed reasonably
punctuation and grammar.] clearly and fluently. Well linked sentences and paragraphs
are usually used. Specialist vocabulary has been used
on a number of occasions but not always appropriately.

Answers

Answers -
Text is legible and most of the meaning is clear. There are anf Cloud storage is the term for storing your data on computer
occasional errors of spelling, punctuation and grammar. 5-6 systems belonging to someone else, and accessing them through
marks: There is evidence of a clear evaluation shown by a the Internet (1). Advantages of cloud storage include that you may
correct explanation and three well justified comments. The access them from anywhere with an Internet connection (1), and
answer covers most of the ideas above or includes other can therefore collaborate with people regardless of distance or
correct answers. The form and style of writing is appropriate time. Local disaster recovery is easier too, since you can restore
to the purpose and complex ideas are expressed clearly and from an online backup (1). Costs are generally lower per MB than
fluently. Sentences and paragraphs follow on from one another local storage (1). On the other hand, however, your data is stored
clearly and coherently. Specialist vocabulary has been used on someone else's computer, so you need to be sure of their
appropriately throughout. Text is legible and the meaning is security measures (1), and of ownership of your data should that
clear. There are few, if any, errors of spelling, punctuation and company be bought or go into bankruptcy. Moving what can be
grammar.] considerable amounts of data from one provider to another can
APPLICATION LAYER also cause problems (1).
ive Both file types use compression to reduce file size (1) and therefore
people may be concerned about the loss of quality as both remove
either image elements or certain audio frequencies (1).
TRANSPORT LAYER 13. It is most effective on images with many continuous pixels of the
same colour ¥ (1)
14. Text data ¥ (1)
15. System software ¥ (1)
INTERNET LAYER 16. Instructions are close to English/easier for humans to read and
write than a low-level language, which means a programmer is
less likely to make errors (1). It's quicker to develop code and
easier to maintain high level code (1). High-level languages are
NETWORK ACCESS (or DATA LINK) LAYER usually available across many platforms or chipsets or operating
systems (1).
ie You can come to either stance but you need to use evidence to
[3 marks: 1 mark for each correct layer] support your response. Answers to include:
IMAP ¥ (1) The advantages of using subroutines over writing the code
Oa 5 megabits per second = 5 000 000 bits per second (3) repeatedly as needed include clearly breaking a big task into little
ones makes the big task more achievable. Using code modules
or subroutines (one for each part of the task) makes it easy to see
which part of the code does which part of the overall task. Updates
are a lot easier — you just change the bit that needs to be updated.
A subroutine may work perfectly one time that it is called, but the
main code may then change the variable used by the subroutine
[6 marks: 2 marks for each correct column] — and the subroutine may fail. Finally, testing through the entire
a) An embedded system is part of a larger system, such as traffic code checking, each iteration of each subroutine, can feel like an
lights, and is designed to work without human intervention. endless task. [6 marks: 1 mark for each point made]
Usually the ‘computer’ part is invisible to the user (1). 18. A patch will fix any known security issues (1) so the machine
b) Any one from: senses cloth quality and density to identify running the application is less vulnerable to cyberattack (1).
quantity of water needed; detect water temperature; manage 19. A way of organising data so that it can be used efficiently ¥ (1)
wash cycle (1). 20. Answers to include: Backup (ideally off-site) to help make
sure that if data is corrupted in some way the copy may be
See used; Passwords to ensure only authorised people gain
sO | access to the data; Access levels to help ensure that only
OF =| the right people gain access to editing or creation options;
ae Redundancy — keeping a parallel system (or resources)
running ready to take over if anything happens to the main
system (or resources).
[6 marks: 1-2 marks: There are a few simple or vague
statements relating to the question. The form and style
of writing used has many deficiencies. Ideas are not
often clearly expressed. Sentences and paragraphs
are often not well-connected or at times bullet points
may have been used. Specialist vocabulary has been
used inappropriately or not at all. Much of the text is
legible and some of the meaning is clear. There are
[3 marks: 1 mark for A and B into an OR gate, 1 mark for O and
many errors of spelling, punctuation and grammar
the output of A and B into an AND gate, 1 mark for the output of
but it should still be possible to understand much of
the gate with O as an input with its output connected to Z]
the response. 3-4 marks: There is evidence of some
evaluation shown through the use of mostly correct
technical explanation linked with advantages in the
situation given. The answer covers a few of the ideas
above or includes other correct answers. The form and

Answers
style of writing used is appropriate to purpose and
expresses some complex ideas reasonably clearly
and fluently. Well linked sentences and paragraphs
are usually used. Specialist vocabulary has been
used on a number of occasions but not always
appropriately. Text is legible and most of the
meaning is clear. There are occasional errors of
spelling, punctuation and grammar. 5-6 marks:
There is evidence of a clear evaluation shown
by a correct explanation and three well justified
comments. The answer covers most of the ideas
above or includes other correct answers. A form
and style of writing appropriate to purpose is
used and complex ideas are expressed clearly
and fluently. Sentences and paragraphs follow
on from one another clearly and coherently.
Specialist vocabulary has been used appropriately
throughout. Text is legible and the meaning is
clear. There are few if any errors of spelling,
punctuation and grammar.]
21. a) Validation is an automatic computer check to
ensure that the data entered is sensible and
reasonable (1).
b) Any two from: check digit; format check; length check;
lookup limit; presence check; range check
[2 marks: 1 mark for each correct answer]
22. A variable is data stored in memory that can be
changed. 4
23. Normal (or typical) (1): e.g. 07625738925 (1)
Extreme (or boundary) (1): 07000000000 or 07999999999 (1)
Erroneous (1): e.g. Sheffield71155 (1)

Answers

Answers .
ACKNOWLEDGEMENTS

The author and publisher are grateful to the


copyright holders for permission to use quoted
materials and images
Cover © Panu Smit/Shutterstock.com
Revision Guide P1 © Asaf Eliason/Shutterstock.com
Workbook P1 © tavizta/Shutterstock.com
All other images and illustrations are
© Shutterstock.com and © HarperCollinsPublishers Revision Guide Exam Practice Complete Revision
Every effort has been made to trace copyright .
ers and obtain their permission panics of Workbook & Practice
copyright material. The author and publisher will Effective revision of the A comprehensive bank The Revision Guide and
gladly receive information enabling them to rectify GCSE course using three of questions to test your Exam Practice Workbook
any error or omission in subsequent editions. All different approaches to understanding of all together in one book for
facts are correct at time of going to press. help you engage with the key topics, including complete preparation.
Published by Letts Educational each topic. practice exam papers.
An imprint of HarperCollinsPublishers
1 London Bridge Street
London SE1 9GF
ISBN: 9780008162061
First published 2016
10987654321
© HarperCollinsPublishers Limited
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,
electronic, mechanical, photocopying, recording |
or otherwise, without the prior permission of
Letts Educational.
British Library Cataloguing in Publication Data.
A CIP record of this book is available from the ae ae
British Library.
Series Concept: Emily Linnett
Author: Sharon Angland
Contributor: Paul Clowrey omnes
Commissioning and Series Editor: Chantal Addy
Editor and Project Manager: Rebecca Rothwell
Index: Indexing Specialists (UK) Ltd.
Inside Concept Design: Paul Oates
Cover Design: Paul Oates
Text Design, Layout and Artwork: Q2A Media * 4
. e ; a > ms Me |

Production: Lyndsey Rogers 9780008160999 |


Printed by RR Donnelley APS cresesitidenniemeeasencns if

MIX | fo ee
al
Paper from &:) es
responsible sources _ou
wa
Ja5
FSC FSC C007454 Es Science Science
; on Combined Combined
U

FSC™ is a non-profit international organisation


established to promote the responsible management
of the world’s forests. Products carrying the FSC 9780008161088 9780008161101
label are independently certified to assure consumers amneern es
that they come from forests that are managed to POTS TE
| et { 4 as
meet the social, economic and ecological needs ] :
ig

l
of present and future generations,
and other controlled sources.

Find out more about HarperCollins


Science Science
and the environment at Combined
—: Combined
www.harpercollins.co.uk/green

5 EASY WAYS TO ORDER 9780008161095

1. Available from:
www.collins.co.uk Q O uwm

www.lettsrevision.com
:g 39 Be
2. Fax your order to 01484 665736
3. Phone us on 0844 576 8126 pa £8 SSS 8s
4. Email us at [email protected] [im Bao" | : ons & 3” & 2
’ :so a ot
5. Post your order to: Collins Education,
seeercst RIKB-SGZT-ZYJL, 9780008162 9780008162054 9780008162061
Honley HD9 6QZ
ee
ek 5

Whether
J MCLiitcl vou
yvuearn by seeing, hearing or doing (or a mix of all
| like
Ac to
ao

three), this complete revision and practice book uses three different
approaches to help you engage with each topic and is packed with
exam-style practice @ opportunities for all-round revision success.

an audio a unique exam-style questions and


(> walk-through magazine-style oo a complete set of practice
of each topic layout papers with answers

ee

networks
of
and
Definitions
itr
wl
types

yorworenao

topic-based practice hands-on revision


questions and quick tests activities

ite
x ~

Find us at www.lettsrevision.cc
¥ Ei facebook.com/ettsrevision
7 -- @lettsrevision

ISBN 978-0-00-816206-

Download the FREE audio book from ||ll|

_www.collins.co.uk/lettsGCSErevision Mis
£10.99
* >

You might also like