0% found this document useful (0 votes)
137 views98 pages

Booksolution Olevel

Uploaded by

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

Booksolution Olevel

Uploaded by

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

Cambridge IGCSE™ and O Level Computer Science

Answers to Student’s Book


Exam-style questions and sample answers have been written by the authors. References to
assessment and/or assessment preparation are the publisher’s interpretation of the syllabus
requirements and may not fully reflect the approach of Cambridge Assessment International
Education. Cambridge International recommends that teachers consider using a range of teaching
and learning resources in preparing learners for assessment, based on their own professional
judgement of their students’ needs.
Cambridge Assessment International Education bears no responsibility for the example answers to
questions taken from its past question papers which are contained in this publication. The questions,
example answers, marks awarded and/or comments that appear in this digital material were written
by the author(s). In examination, the way marks would be awarded to answers like these may be
different.

1 Data representation
Answers to activities
1.1
a 51
b 127
c 153
d 116
e 255
f 15
g 143
h 179
i 112
j 238
k 487
l 1364
m 3855
n 1992
o 2047
p 31984
q 16141
r 49983
s 34952
t 32767

1
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

1.2
a 00101001
b 01000011
c 01010110
d 01100100
e 01101111
f 01111111
g 10010000
h 10111101
i 11001000
j 11111111
k 1000000011101000
l 0000001101111000
m 0000111111111111
n 0100000000010000
o 1111001101100011
1.3
a C3
b F7
c 27F
d 4EE
e 1E1
f 89E
g (0)4FE
h (0)E9C
i FF7D
j 67AE
1.4
a 0110 1100
b 0101 1001
c 1010 1010
d 1010 0000 0000
e 0100 0000 1110
f 1011 1010 0110
g 1001 1100 1100
h 0100 0000 1010 1010
i 1101 1010 0100 0111
j 0001 1010 1011 0000

Cambridge IGCSE and O Level Computer Science Teacher's Guide © David Watson and Helen Williams 2021
Answers to Student’s Book 2
1.5
a 107
b 156
c 74
d 255
e 511
f 2561
g 2996
h 3240
i 4782
j 44425
1.6
a 62
b E3
c 1EA
d 1FF
e 33A
f 3E8
g A4A
h E9F
i FA7
j 1388
1.7
1 Student investigation
2 a 35, 37, 8B
b C9, 7A, CC
c C, 6F, 51
1.8
a 10000011
b 01100110
c 01111011
d 10110110
e 01101111
f 10110111
g 01111110
h 01110000
i 11111110
j 11011101

Cambridge IGCSE and O Level Computer Science Teacher's Guide © David Watson and Helen Williams 2021
Answers to Student’s Book 3
Answers to Student’s Book

1.9
a 98 = 01100010 and 15 = 00001111; sum = 01110001 (= 113)
b 29 = 00011101 and 88 = 01011000; sum = 01110101 (= 117)
c 49 = 00110001 and 100 = 01100100; sum = 10010101 (= 149)
d 51 = 00110011 and 171 = 10101011; sum = 11011110 (= 222)
e 82 = 01010010 and 69 = 01000101; sum = 10010111 (= 151)
f 100 = 01100100 and 140 = 10001100; sum = 11110000 (= 240)
g 19 = 00010011 and 139 = 10001011; sum = 10011110 (= 158)
h 203 = 11001011 and 30 = 00011110; sum = 11101001 (= 233)
i 66 = 01000010 and 166 = 10100110; sum = 11101000 (= 232)
j 211 = 11010011 and 35 = 00100011; sum = 11110110 (= 246)
1.10
1 a 89 = 01011001 and 175 = 10101111; sum = 1 00001000 (= 8)
overflow error has occurred (9 bits)
b 168 = 10101000 and 99 = 01100011; sum = 1 00001011 (= 11)
overflow error has occurred (9 bits)
c 88 = 01011000 and 215 = 11010111; sum = 1 00101111 (= 47)
overflow error has occurred (9 bits)
2 a 1101 1111 0010 1010 – result is correct
b 1 1110 1011 1110 0100 – overflow error has occurred
1.11
1 a denary value = 64 + 32 + 8 = 104
00001101
b denary value is 13 (104 ÷ 8) therefore shift three places right is the same as division by
23 (i.e. 8)
c denary value = 15
11110000
d denary value is 240 (15 × 16) therefore shift four places left is the same as multiplication by
24 (i.e. 16)
2 a 29 = 00011101 and 51 = 00110011
b sum = 01010000
c 00001010
d 75 = 01001011
e 01010101
f 10101010

4
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

1.12
1 a 00100111
b 01000010
c 01011000
d 01100110
e 01101111
f 01111101
g 01001101
h 00010100
i 00110001
j 00111000
2 a 85
b 51
c 76
d 126
e 15
f 125
g 65
h 30
i 113
j 120
1.13
a 11101110
b 11100001
c 11010001
d 11000001
e 10101000
f 10100100
g 10011100
h 11111111
i 11110000
j 10000001

Cambridge IGCSE and O Level Computer Science Teacher's Guide © David Watson and Helen Williams 2021
Answers to Student’s Book 5
Answers to Student’s Book

1.14
a −51
b −66
c −17
d −121
e −96
f −7
g −81
h −1
i −127
j −10
1.15
1 i The number of possible colours of a group of pixels (usually three or four) based on the bit
depth.
ii The coding system for all the characters on a standard keyboard and control codes; extended
ASCII, gives another 128 codes to allow for characters in non-English alphabets and for
some graphical characters to be included.
iii The coding system which represents all the languages of the world (the first 128 characters are
the same as ASCII code).
iv The number of sound samples taken per second.
v Images which are made up of pixels.
2 i, ii, iii each colour is 28 = 256
iv 256 × 256 × 256 = 16 777 216 possible colours
3 They both increase the size of the sound file.
1.16
1 1920 × 1536 = 2 949 120 pixels

colour depth = 16 ⇨ 16 × 2 949 120 = 47 185 920 bits

bits (÷ 8) ⇨ 5 898 240 bytes

(÷ (1024 × 1024)) ⇨ 5.625 MiB

2 1024 × 1536 = 1 572 864 pixels

colour depth = 24 ⇨ 24 × 1 572 864 = 37 748 736 bits

bits (÷ 8) ⇨ 4 718 592 bytes


16 GiB = 17 179 869 bytes

⇨ number of photos = (17 179 869)/(4 718 592) = 3640 photos

3 a sample size = 44 100 × 8 × 2 (two tracks) = 705 600 bits


b file size = 44 100 × 8 × 30 × 2 (two tracks) = 21 168 000 bits

bytes (÷ 8) ⇨ 2 646 000 bytes = 2.5 MiB


6
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

4 sample size = 44 100 × 16 × 210 × 2 (two songs) = 296 352 000 bits

bytes (÷ 8) ⇨ 37 044 000 bytes ⇨ 35.33 MiB

⇨ 740 MiB CD can store 740/35.33 = 20.94 ⇨ 20 full songs

Answers to exam-style questions


Answers to questions 6 and 7 in this section are example answers for past paper questions. The details of the
relevant past paper can be found with the corresponding exam-style question in the Student’s Book.
1 a i The number of bits used to represent sound amplitude.
ii Better sound quality
Less sound distortion
b i The number of pixels that make up an image; for example, an image could contain 4096 ×
3192 pixels (i.e. 12 738 656 pixels in total).
ii 4 bits 16 colours
iii 16 384 × 512 = 8 388 608 pixels
Colour depth = 256 (8 bits per pixel)

⇨ 8 388 608 × 8 = 67 108 864 bits

⇨ (67 108 864/(1024 × 1024 × 1024)) = 0.0625 GiB

iv The developer may wish to use lossy compression and use the JPEG format to save
space on their camera and/or computer.
2 a The editor decides how many bits to represent the sound amplitude. Increasing the number of bits
to represent sound amplitude increases accuracy; this is sampling resolution. The editor also
decides how many samples per second should be taken; this is the sampling rate – the higher
the number of sound samples per second, the better the quality of the sound recording.
b The editor will use lossy format, for example, MP3 format, which uses perceptual music
shaping, which removes sounds the ear cannot hear properly, therefore the sound quality is
essentially retained.
Lossless files would be larger than lossy files for little improvement in sound quality. c i
RLE is a form of lossless compression. It reduces the size of a string of adjacent, identical
data, for example, repeated colours of an image. The repeating string is
encoded into two values; one value represents the number of identical items and the
second value represents the code of the data item (ASCII code).
ii 3G 2W 4G 9W 4G 2W 1G 2W 2G 2W 1G (W = 1 and G = 0)

⇨ 30 21 40 91 40 21 10 21 20 21 10
8 × 4 grid = 32 bytes
RLE code = 11 × 2 = 22 bytes

⇨ RLE saves 10 bytes of memory/storage


7
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

3 a 32 + 16 + 4 + 2 = 54 (base 10)
bi00011011
ii 16 + 8 + 2 + 1 = 27 (base 10)
ci11011000
ii 128 + 64 + 16 + 8 = 216 (base 10)
Therefore two places shift to the left = multiply by 4 (22)
4 a Parts i to iii
01111011
00110111
10110100
b i 123 + 55 = 0 1 1 1 1 0 1 1 + 0 0 1 1 0 1 1 1 = 1 0 1 1 0 0 1 0 (178)
ii 123 + 180 = 0 1 1 1 1 0 1 1 + 1 0 1 1 0 1 0 0 = 1 0 0 1 0 1 1 1 1 (47), which is
incorrect; overflow has occurred
ci01110100
two’s complement gives: 1 0 0 0 1 1 0 0 (−116)
ii −112 = 1 0 0 1 0 0 0 0
iii 1 0 1 1 1 0 0 1 = −128 + (32 + 16 + 8 +1) = −128 + 57 = −71
di01101000
ii 1 0 0 1 1 0 0 0
5 a A picture element is the smallest element used to make up an image; each pixel is represented
by a minimum of 8 bits and 3 pixels are needed to make up the RGB colours. b The number of
possible colours of a group of pixels (usually three or four) based on the bit depth.
c 1140 × 1080 = 1 231 200 pixels

⇨ 1 231 200 × 24 = 29 548 800 bits

⇨ (29 548 800)/8 = 3 693 600 bytes


Memory card is 32 × (1024 × 1024 × 1024) bytes

⇨ number of photos = (32 × 1024 × 1024 × 1024)/(3 693 600) = 9302 photos d Use file
compression (e.g. JPEG) which reduces the size of the files/images being stored. Therefore
more files/images can be stored on a memory stick.
8
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

6 a • image converted from analogue to digital

• image turned into pixels

• each pixel is given a binary value

• pixels form a grid/pattern

• each pixel has associated colour

• pixels are stored in sequence

• meta data stored (dimensions, colour depth, etc.)

• for example, JPEG, raw, TIFF, PSD, PNG

b Lossy:

• lossy would reduce file size more than lossless

• unnecessary data removed from the file

• images can be of similar quality/won’t notice any difference

• no requirement for files to be the same as the original

• can send photos faster/faster to upload

7a
Hours 0 0 0 0 0 0 1 0

Minutes 0 0 0 1 1 1 1 1

Seconds 0 0 1 1 1 0 1 0
b00000101=5
0 0 0 1 1 0 1 0 = 26
0 0 1 1 0 1 1 1 = 55
Time shown as:

8 a 64 GiB = 64 × 1024 × 1024 KiB

⇨ (64 × 1024 × 1024)/10 = 6 710 886 photos

b i Use JPEG lossy file compression


ii • saves storage space

• faster to send photos by email

• quicker to download/upload photos

iii loss of quality


c i Each primary colour intensity needs to be stored as a byte to allow for sufficient
different colour variations.
ii 28 × 28 × 28 = 256 × 256 × 256 = 16 777 216

9
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
9

Cambridge IGCSE and O Level Computer Science Teacher's Guide © David Watson and Helen Williams 2021
Answers to Student’s Book 10
Cambridge IGCSE™ and O Level Computer Science

Answers to Student’s Book


Exam-style questions and sample answers have been written by the authors. References to
assessment and/or assessment preparation are the publisher’s interpretation of the syllabus
requirements and may not fully reflect the approach of Cambridge Assessment International
Education. Cambridge International recommends that teachers consider using a range of teaching
and learning resources in preparing learners for assessment, based on their own professional
judgement of their students’ needs.
Cambridge Assessment International Education bears no responsibility for the example answers to
questions taken from its past question papers which are contained in this publication. The questions,
example answers, marks awarded and/or comments that appear in this digital material were written
by the author(s). In examination, the way marks would be awarded to answers like these may be
different.

2 Data transmission
Answers to activities
2.1
1 Parts i and ii

• picture and sound out of synchronisation

• packets arriving at different times

• pauses in the video

• time delay in assembling packets

• degraded video and sound

• caused by competing traffic on the communications link

• possible 'drop out'

• packets take different routes, so some may get lost

2 • web page divided into data packets

• each packet has an IP address of the destination

• routers check header against IP address values to determine next router to send data packet •
hop value checked to see if it is zero

• destination computer reassembles data packets to build up the web page

3 a This takes all the 1-values in the payload and adds them together to generate a hex number. • this

hex value is stored in the trailer

• receiving computer carries out the same calculation on received payload

• if values match, data packets has been received error-free


• if values do not match, data packet needs to be re-sent

b 29 1-bits ⇨ 1D in hex. If recalculated value doesn’t equal 1Dhex then it needs to be re-sent. 4 a •

packets keep 'bouncing around' from router to router and never reach the destination • use hop
numbers; if hop number = 0 then the packet is deleted and is therefore lost

1
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

b • apply a hop number … Answers to Student’s Book

• … each time a data packet reaches a router, the hop number is decreased by 1

• … once the hop number = 0, and the destination hasn’t been reached, then the data
packet is deleted
c • each packet takes a different route …

• … therefore if a packet is intercepted, hacker still won’t have the whole message 2.2

1 i data sent one bit at a time over a single channel in both directions, but not at the same time ii
several bits of data sent down multiple channels in both directions, at the same time iii data sent
one bit at a time over a single channel in one direction only
2 i serial, simplex data transmission
ii parallel, simplex data transmission
iii parallel, full-duplex data transmission
iv serial, full-duplex data transmission
v parallel, simplex data transmission
2.3
Statement True False

Packets have a header which contains the IP address of the sender and
the receiver ✔


Packets don’t require any form of error checking

USBs use a protocol that allows for error-free data transmission


between device and computer ✔


Serial data transmission suffers from data skewing


The longest cable length supported by USB is 5 metres or less
Simplex data transmission occurs when data is transmitted one bit at
a time ✔

Full-duplex data transmission involves sending 8 bits of data at a time


USB uses serial data transfer


Packet switching prevents loss of any data packets


USB connections can transfer data using half-duplex or full-duplex


2.4
Parity bits: 1, 0, 1, 1, 0, 0, 1, 0, 1, 0
2.5
1 no error, error, error, no error, error, error, no error, no error, no error, no error

2
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

2 It isn’t possible to determine where the error occurred.


2.6
1 error occurred in: byte 4 (four 1-bits)
and in: bit 6 (four 1-bits)
byte 4 should be: 0 1 1 0 1 1 1 0
2 error occurred in: byte 8 (three 1-bits)
and in: bit 7 (three 1-bits)
byte 8 should be: 0 1 0 1 0 0 1 1
2.7
1 9 + 8 + 5 + 0 + 5 + 5 = 32
3 × (7 + 1 + 1 + 4 + 7 + 9) = 3 × 29 = 87
(32 + 87)/10 = 119/10 = 11 remainder 9
10 – 9 = 1, the check digit
2 i ISBN 13: 2 + 3 + 1 + 0 + 0 + 2 = 8
3 × (1 + 1 + 1 + 0 + 4 + 8) = 3 × 15 = 45
(8 + 45)/10 = 53/10 = 5 remainder 3
10 – 3 = 7, the check digit
Modulo-11: sum = (13 × 2) + (12 × 1) + (11 × 3) + (10 × 1) + (9 × 1) + (8 × 1) + (7 × 0) +
(6 × 0) + (5 × 0) + (4 × 4) + (3 × 2) + (2 × 8)

⇨ 26 + 12 + 33 + 10 + 9 + 8 + 0 + 0 + 0 + 16 + 6 + 16 = 136
136/11 = 12 remainder 4
11 – 4 = 7, the check digit
ii ISBN 13: 9 + 9 + 1 + 1 + 3 + 4 = 27
3 × (0 + 8 + 2 + 2 + 5 + 4) = 3 × 21 = 63
(27 + 63)/10 = 90/10 = 9 remainder 0
check digit = 0
Modulo-11: sum = (13 × 9) + (12 × 0) + (11 × 9) + (10 × 8) + (9 × 1) + (8 × 2) + (7 × 1) +
(6 × 2) + (5 × 3) + (4 × 5) + (3 × 4) + (2 × 4)

⇨ 117 + 0 + 99 + 80 + 9 + 16 + 7 + 12 + 15 + 20 + 12 + 8 = 395
395/11 = 35 remainder 10
11 – 10 = 1, the check digit
2.8
1 Tom would need to send Jane his public key.
2 Two keys are required; one of the keys is only known to the recipient of the document (i.e.
the private key).

3
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

2.9
a E – text following an encryption algorithm
b B – the receiver
c B – plaintext
d E – there is a security problem when transmitting the encryption key
e A – symmetric key encryption
f E – check digit
g A – automatic repeat request
h B – parity check
i D – checksum
j A – echo check

Answers to exam-style questions


Answers to questions 7 and 8 in this section are example answers for past paper questions. The details of the
relevant past paper can be found with the corresponding exam-style question in the Student’s Book.
1 a i Data is returned to sender. Sender’s computer compares the two sets of data. If any errors
found, then the data is re-sent.
This doesn’t make it a very suitable method for this application.
ii ARQ uses acknowledgement and timeout. When a receiving device detects an error
following data transmission, it asks for the data to be re-sent. If there are no errors, a
positive acknowledgement is sent to the sender.
The sending device will re-send data if:
• it receives a request to re-send data

• a timeout has occurred.


The whole process is continuous until all data packets received are error-free or until
the timeout is reached.
b Three differences from:
Checksum Check digit
• calculated from the block of data • sent with block • final digit included in the code
of data
• calculated from the other digits in the code • used to check
• re-calculated at the receiving station • if different, an
for errors during data entry • detects errors such as
error has occurred
transposition, missing/extra digits, and so on
• used to check errors following data transmission

4
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

2 i Packet switching is a method of data transmission where a message is broken into many data
packets, which can then be sent along different pathways independently of each other. ii Cyclic
redundancy check is an error-checking method which adds up all the 1-bits in the data packet
payload and stores this hex number in the trailer; the same calculation is done at the receiving
station.
iii Data skewing occurs when data arrives at the destination with the bits no longer
synchronised; this usually occurs during parallel data transmission.
iv Universal serial bus is a type of serial data transmission which has become the industry
standard for connecting computers to devices using the USB port.
v Parity bit (0 or 1) is added to a byte of data in the most significant bit position (left-most bit);
this ensures that the byte follows the correct even parity or odd parity protocol.
Description Checksum Parity ARQ
✔ check ✔ ✔

Extra bit sent with each byte of data


Makes use of timeout and acknowledgement



If an error is found, a request is made to re-
send the data ✔

Check on whether a data packet has


been changed following transmission ✔ ✔

Re-calculation made on any additional


data values sent to the recipient ✔ ✔

Data is transmitted in blocks or packets


✔ (✔) ✔

A method that can determine which bit in


a data stream has been changed ✔

Additional value sent at the end of a block


of data to be used to check if any data ✔
transmission errors occurred

4 a Sequence: iii, i, ii, iv


b Sequence: v, ii, iii, iv, i
c Sequence: ii, iii, i, iv, v
d Sequence: vi, v, ii, iv, iii, i
5 a Symmetric encryption occurs when the same encryption key is used to encrypt and decrypt a
message.
b Asymmetric encryption uses public keys (known to everyone) and private keys (known to a
single user only); the recipient sends a public key to each sender who uses it to encrypt the
message. The encrypted message is then decrypted using a matching private key at the
recipient’s computer.
c If data is intercepted it cannot be understood by a hacker/eavesdropper without the correct
decryption key.
5
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

Cambridge IGCSE and O Level Computer Science Teacher's Guide © David Watson and Helen Williams 2021
Answers to Student’s Book 6
7ai Answers to Student’s Book
Method 1 Method 2
Tick ✔ Tick ✔

Serial Simplex

Parallel Half-duplex

Full-duplex

ii Serial has lower/less interference.


Serial is more reliable over long distances.
In serial, bits won’t be skewed/out of synchronisation.
In serial, it is easier to collate bits together again after transmission.
Full-duplex transmits data in both directions at the same time.
Simplex and half-duplex won’t allow read and write operations at the same time. b
Any two from:
Checksum:

• value calculated from the data block

• this value is transmitted along with the data

• checksum recalculated after transmission

• if the values match, data has been transmitted error-free


Parity check:

• parity bit is transmitted with each byte of data

• odd or even parity protocol is being used

• number of 1-bits are added together to determine if parity bit is 0 or 1

• byte checked at destination to see if it has the correct parity protocol (odd or even) • if
the parity has changed, an error has occurred
ARQ:

• uses acknowledgement and timeout

• when device detects an error in the data transmission, it requests the packet to be re-
sent; if no error, a positive acknowledgement is sent

• sending device re-sends packet after request to re-send is made/timeout reached •


process is continuous until the data packet received is correct/until ARQ time limit is
reached
Echo check:

• copy of data sent back to sender

• data is compared to see if they match

• if it does not match, error has been detected


7
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

8a Answers to Student’s Book


Statement True False
✔ ✔

Full-duplex data transmission can be either serial or parallel


Full-duplex data transmission is when data is transmitted both ways,


but only one way at a time ✔

Full-duplex transmission is always used to connect a device to


a computer ✔

Full-duplex data transmission is when data is transmitted both ways


at the same time ✔

Full-duplex data transmission automatically detects any errors in data


b parallel data transmission


c Two from:

• universal standard, so it is likely to be compatible with the computer • can only be inserted

one way, so there is less chance of connecting a device incorrectly • high-speed data
connection, so data transmission is fast

• uses serial transmission, so less chance of skewing errors

• does not require (wireless) network, therefore can be used even if network is down •
backwards compatible, so no additional technology required

• no need for a separate power source, because USB supplies (5V) power • drivers are
automatically identified/loaded, so no need to find them online/installs drivers
automatically
8
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Cambridge IGCSE™ and O Level Computer Science

Answers to Student’s Book


Exam-style questions and sample answers have been written by the authors. References to
assessment and/or assessment preparation are the publisher’s interpretation of the syllabus
requirements and may not fully reflect the approach of Cambridge Assessment International
Education. Cambridge International recommends that teachers consider using a range of teaching
and learning resources in preparing learners for assessment, based on their own professional
judgement of their students’ needs.
Cambridge Assessment International Education bears no responsibility for the example answers to
questions taken from its past question papers which are contained in this publication. The questions,
example answers, marks awarded and/or comments that appear in this digital material were written
by the author(s). In examination, the way marks would be awarded to answers like these may be
different.

3 Hardware
Answers to activities
3.1
1 a address bus, data bus, control bus
b address bus: carries addresses throughout the computer; it is unidirectional
data bus: bidirectional bus allowing data to be sent throughout the computer
control bus: carries signals from the control unit to all other computer components; it
is bidirectional
c • wider address and data buses would increase computer performance

• wider control bus would have little, if any, effect on performance

• higher clock speed would increase processor speed, (overclocking could have serious
consequences however, such as unsynchronised operations or overheating)
2 fetches
current instruction register (CIR)
program counter (PC)
memory address register (MAR)
address bus
memory data register (MDR)
decoded
executed
control signals
control bus
arithmetic and logic unit (ALU)
accumulator (ACC)
1
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

3.2

1 a • increasing the width of the address bus and width of the data bus •

increasing clock speed but care needed to avoid over-clocking

• use of larger cache memories (uses static RAM) which have faster data access time than
normal RAM (which is dynamic)

• using dual core and quad core processors; but doubling number of cores doesn’t double
processor performance since the CPU needs to communicate with each core which uses up
time
b • instructions are a set of operations which are decoded in sequence

• each operation is made up of an opcode (which informs the CPU about what operation

needs to be done) and an operand (data which needs to be acted on/register) • limited number
of opcodes exist and this is known as an instruction set

• instruction sets are low level language instructions which instruct the microprocessor how
to carry out an operation
2 a • destination address input

• other factors (e.g. avoiding toll roads) are input

• data from satellites, which gives the location of three or four satellites … • …
together with very accurate timings

• Sat Nav computer uses satellite data to calculate the position of a car on the
stored maps

• this combination allows accurate tracking of the vehicle on stored roads b • use of satellite
or cellular network used to download the latest map updates/software updates

• if the Sat Nav is a portable unit, it can be connected to a computer via USB port and new
maps/software will be downloaded
3.3
1 a || wwwbwbb/wwwbbwb/wwwbbwb || bwwwwbw/bwbbbww/bbbwwbw || b ||
wwbbwwb/wwbwwbb/wbbwwwb/wbbbwbb ||
bwbwwww/bwbwwww/bwbbbww/bwwbwww ||
c || wwwbbwb/wbbwwwb/wbbwbbb/wbbwbbb/wwwbwbb ||
bbbwwbw/bbwbbww/bbbwbww/bbwwbbw/bwwbwww ||
2 a • hold more information

• fewer errors due to built-in error-checking in QR codes

• easier to read – QR codes can be read by a smartphone/tablet camera and app •


QR codes can be encrypted
b 40 × 40 = 1600 pixels = 1600 bits = 200 bytes
c • they are used as a form of alignment when reading the QR code

• the remaining corner square is used to ensure the correct size and correct angle of QR
camera shot
d • more than one QR format exists

2
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

• QR codes can contain malicious codes (called attagging); QR code software is free;
therefore, it is easy to embed malicious software or fake websites
3.4
1 a Laser printer:

• uses dry powdered ink (toner)

• makes use of the properties of static electricity to produce text and images on paper •
prints whole page in one go

• ink is fused onto paper using heated rollers


Inkjet printer:

• uses liquid ink in four or five cartridges

• printing is done line by line as paper advances forward after each printed line • ink
droplets are ejected onto paper using thermal bubble or piezoelectric technology b Parts i and ii
Laser printer:

• high-quality flyers and posters (in large quantities)

• any large volume printing job

• equipped with large capacity toner cartridges

• have large paper trays


Inkjet printer:

• one-off printouts, such as photos

• small batch printing jobs

• can print on various types of paper and other media (for example, can print on T-shirts)

• where small paper trays and small capacity ink cartridges are not important for small print
jobs
2 Order: C, E, G, A, I, B, F, H, D
3 a In an LCD–LED screen, each pixel is made from liquid crystals that are backlit using LEDs.
In pure LED screens, the pixels are made up of the LEDs themselves. b LEDs:

• use less power


• they do not need to warm up to reach maximum brightness

• produce a 'whiter' light

• produce a brighter light

• last for much longer

4 • Filipe uses an application on his computer that can play music files. • The application finds the

files on the backing store (HDD or SSD) and moves it into RAM.

• The data in the file is read by the application and then sent via a device driver to
loudspeakers which are connected to the computer.

• The device driver software translates the digital data into a series of analogue electrical
signal using a digital-to-analogue converter (DAC).

• The electrical signals make the loudspeaker cones move, through the use of a solenoid. • If
the file is a stereo recording then two different signals are sent to each loudspeaker.

3
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

• The movement of the loudspeaker cone moves molecules of air, which Filipe's ears detect, and
means he can hear music.
3.5
1 a Control:

• sensors used to collect data to send to a microprocessor

• sensor data is compared to stored/pre-set data

• the output affects the next set of inputs

• microprocessor sends signals to actuators to operate valves, motors and switches


Monitoring:

• sensors used to collect data to send to a microprocessor

• sensor data is compared to stored/pre-set data

• no actual changes to the process are made

• results of data comparison are shown on a screen/printed out or an alarm is activated b •


temperature and humidity sensors are used

• both sensors constantly send data to a microprocessor

• the data is converted to digital, if necessary, using an ADC

• the temperature levels are set by the user …


• … humidity levels are set at the factory

• if the temperature sensor reading > set temperature, the microprocessor will send a
signal to an actuator …

• … to switch on the air conditioning unit

• if the temperature sensor reading <= the set temperature, the microprocessor will send a
signal to an actuator …

• … to switch off the air conditioning unit

• if the humidity sensor reading > factory set value, the microprocessor will send a signal to an
actuator …

• … to switch on the air conditioning unit

• if the humidity sensor reading <= the factory setting AND temperature sensor reading <
the set temperature …

• … the microprocessor will send a signal to an actuator to switch off the air
conditioning unit

• the process is continuous

2 • pH sensors send data back to microprocessor

• data changed to digital if necessary (using ADC)

• if pH < stored value then microprocessor sends signals to actuators …

• … to open valve to add alkaline solution to soil

• if pH > stored value then microprocessor sends signals to actuators …

• … to open valve to add acidic solution to soil

• if pH = stored value then microprocessor sends signals to actuators …

4
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

• … to close all valves

• the process is continuous


3 • readings taken from pressure and temperature sensors

• readings changed to digital if necessary (using ADC)

• readings are sent to microprocessor

• if temperature > stored value, microprocessor sends signal to actuators … • …


to open water valves

• if temperature <= stored value, microprocessor sends signals to actuators … • …


to close water valves

• if pressure >= stored value, microprocessor sends signals to actuators … • …


to close CO2 gas valves

• if pressure < stored value, microprocessor sends signals to actuators …

• … open CO2 gas valves

• monitoring/control is continuous

4 • pressure sensors in all four roads at junction used to detect vehicles approaching lights in all
directions

• data is sent back to a microprocessor

• number of vehicles approaching each set of traffic lights is calculated by the


microprocessor based on sensor data

• generated data is compared to a data model stored in the microprocessor system •


signals sent by the microprocessor to alter light sequences as required

• monitoring of roads is a continuous process

3.6
1 a RAM – settings (time, weight, defrost, …)
ROM – microwave wavelength, pre-programmed cooking times, safety systems b
RAM – temperature settings
ROM – control program to monitor fridge
c RAM – user settings, bespoke programs
ROM – wavelength of remote signals, pre-programmed flights, …
3.7
1 RAM:

• used by both OS and applications software

• when phone switched on, it pulls OS and app data from solid state memory to allow it to
function; user’s data
Solid state:

• used to store apps and operating system so that it is always there even when phone
switched off

• part of solid-state memory not accessible to users (for example, the OS) •
stores user’s photos, music files, and so on
2 a • uses movement of data between RAM and HDD/SSD

5
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book
• RAM is physical memory and virtual memory is RAM + swap space on HDD/SSD • to
execute a program, data is loaded into RAM from HDD/SSD

• gives the illusion that RAM is much larger than it really is

b • when P5 wants access to RAM we use virtual memory since RAM is full • assuming P1 is

oldest data, P1 data (10 GiB) is moved out of RAM into HDD/SSD • P5 now points to
memory space in RAM once occupied by P1

• process continues to allow all five programs to run in RAM

4a
3

RAM: ROM:
• temporary memory device

• volatile memory

• can be written to and read from • used to store


data, files, programs, part of OS currently in use

• can be increased in size to improve operational


speed of a computer

• a computer has far more RAM memory than


ROM memory
b For example:
• permanent memory device

• non-volatile memory device

• read-only

• used to store the boot-up instructions • an increase in the


amount of ROM has no effect on computer performance
• RAM – used by a PC to store the contents of an application when the computer is
running

• ROM – used by a PC to find out what it should to do when the power is switched on

6
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

5 a electrons
NAND
matrix
intersection
control gate
floating gate
electrons
control gate

b Compared to HDDs, SSDs: • have faster data access times

• are lighter

• consume less power

• don’t get as hot

• are thinner

• are more reliable


Answers to Student’s Book
c More expensive – questions over how long they can store data for
3.8
1 a • A network interface card (NIC) is needed to allow a device to connect to a network (such as
the internet).

• It is usually part of the device hardware and contains the Media Access Control (MAC)
address generated at the manufacturing stage.
b • Media Access Control is an address which refers to a number which uniquely identifies a
device on the internet.

• It takes the form: NN-NN-NN-DD-DD-DD.

c • Internet Protocol identified either as IPv4 or IPv6

• It gives a unique address to each device connected to the internet which identifies their
location.
d • These enable data packets to be routed between the different networks, for example, to join a
LAN to a WAN onto the internet.
e • A server that automatically provides and assigns an IP address.
2 a • changes each time a device connects to the internet

• allows for greater privacy

• can be less reliable for some applications (e.g. VoIP)

b • IP address is associated with a particular device and does not change each time the device
connects to the internet

• allows faster upload and download speeds

• less privacy as a specific device can be identified by its IP address

c Dynamic IP addresses are needed for the following reasons:

• they give greater privacy since they change each time a user logs on

7
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

• dynamic IP addresses can be an issue when using, for example, VoIP since this type of
addressing is less reliable as it can disconnect and change the IP address causing the
VoIP connection to fail
Static IP addresses are needed for the following reasons:

• since static IP addresses don’t change, they allow each device to be fully traceable •
allow for faster upload and download speeds
3 MAC:

• Permanent address associated with the piece of hardware

• Unique
• 48-bit address

• Used to find the particular device within a network


IP:

• An address assigned to hardware by an ISP – even a static IP address is not physically


associated with the hardware

• Not necessarily unique

• 32 (IPv4) or 128 (IPv6) bit address

• Used to route data to the correct network

Answers to exam-style questions


Answers to questions 7–9 in this section are example answers for past paper questions. The details of the
relevant past paper can be found with the corresponding exam-style question in the Student’s Book.
1 a • The plastic, organic layers of an OLED are thinner, lighter and more flexible than the crystal
structures used in LEDs or LCDs.

• The light-emitting layers of an OLED are lighter; OLED layers can be made from
plastic rather than the glass used in LED and LCD screens.

• OLEDs give a brighter light than LEDs.

• OLEDs do not require backlighting like LCD screens – OLEDs generate their own
light.

• Since OLEDs require no backlighting, they use much less power than LCD screens
(most of the LCD power is used to do the backlighting); this is very important in
battery-operated devices such as mobile phones.

• Since OLEDs are essentially plastics, they can be made into large, thin sheets (this means

they could be used on large advertising boards in airports, subways, and so on). • OLEDs have
a very large field of view, about 170 degrees, which makes them ideal for use in televisions
and for advertising screens.
b • many colours are possible if each primary colour (RGB) uses several bits to represent its
colour intensity …

• … for example, 32 bits per colour gives 232 × 232 × 232 possible colour combinations •
however, the human eye cannot detect more than a few thousand different colour shades

• … therefore, it is impossible to experience the 1 million different colours as claimed by the


manufacturer

8
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

• television contrast (etc.) needs to be set up perfectly to show all colours accurately 2 a i
Two from:

• cannot be changed by the user

• more difficult to copy the software

• immediately available as soon as device powered up

• programs are permanently stored

ii RAM allows the user to store their own data, such as game status

• only the part of the software needed at each stage in the game would be in RAM at any
time
iii USB ports allow other games stored on memory sticks, for example, to be plugged into the
games console

• can plug the console into external speakers for better sound effects

• can plug in keyboard and/or mouse to navigate menu systems

• can plug in VR headsets for consoles with this capability

b • the design may change several times …

• … therefore, it is cheaper and quicker to make a prototype using a 3D printer • the 3D


solid object lets the development team see how well it will work in real life before
building the final version
3 a • both use sensors to gather data

• in control, the output affects the input and actuators are used to change the process (for
example, open valve, operate pump)

• in monitoring, no changes to the process are made; the system simply shows the status on a
screen or prints out data or sounds an alarm
b • temperature and humidity sensors are used

• both sensors constantly send data to a microprocessor

• the data is converted to digital, if necessary, using an ADC

• the temperature levels are set by the user …

• … humidity levels are set at the factory

• if the temperature sensor reading is > set temperature, the microprocessor will send a
signal to an actuator …

• … to switch on the air conditioning unit

• if the temperature sensor reading <= the set temperature, the microprocessor will send a
signal to an actuator …

• ... to switch off the air conditioning unit

• if the humidity sensor reading > factory set value, the microprocessor will send a signal to an
actuator …

• … to switch on the air conditioning unit


• if the humidity sensor reading <= factory setting AND temperature sensor reading < set
temperature …

• … the microprocessor will send a signal to an actuator to switch off the air
conditioning unit

9
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

4 a • static IP address doesn’t change


• the process is continuous
Answers to Student’s Book

• dynamic IP address is a temporary IP address assigned to a device each time it logs onto
the internet

• dynamic IP addresses make use of a Dynamic Host Configuration Protocol (DHCP)


server which assigns the IP addresses whereas static IP addresses are assigned by the
ISP

• static IP addresses assigned to servers which host websites or to FTP servers; this gives the
device a consistent location and also means less bandwidth is used reducing network
traffic (and takes less time to retrieve data)

• dynamic IP addresses afford greater privacy since they change each time a device logs onto
the internet, therefore it makes the device more difficult to trace
b • MAC address is a media access control address

• MAC is used to uniquely identify a device

• uses the format: NN – NN – NN – DD – DD – DD

• where NN – NN – NN refers to the manufacturer and DD – DD – DD refers to the


serial number of the device

• there are two types referred to as UAA (set at factory) or LAA (can be changed by
user)
5a
10
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

b RAM: ROM:

• temporary memory device

• volatile memory

• can be written to and read from

• used to store data, files, part of OS currently in use

• can be increased in size to improve the performance of


computer
• permanent memory device • non-volatile

memory device • data cannot be altered

• sometimes used to store the BIOS and other start-up


procedures
c DVD: Blu-ray:

• uses red laser technology • uses blue laser technology

• storage capacity is ~ 4.7 GB max • doesn’t • storage capacity can be up to ~ 50 GB • allows


allow great interactivity
much greater interactivity • has built-in data
• relatively easy to copy
encryption

• data transfer rate is ~ 10 Mbps • data transfer rate is ~ 36 Mbps

• always comes in dual-layer format 6 a • can come in single-layer, dual-layer … up to 6-layer


formats
Capacitive touch screens:

• capacitive touch screens are composed of a layer of glass (protective layer), a


transparent electrode (conductive) layer and a glass substrate

• since human skin is a conductor of electricity, when bare fingers (or special stylus)

touch the screen, the electrostatic field of the conductive layer is changed • the installed
microcontroller is able to calculate where this change took place and hence determine the
coordinates of the point of touching

• with surface capacitive screens, sensors are placed at the corners of a screen • small

voltages are also applied at the corners of the screen creating an electric field • a finger
touching the screen surface will draw current from each corner reducing the capacitance

• a microcontroller measures the decrease in capacitance and hence determines the point
where the finger touched the screen

• this system only works with a bare finger or stylus

• with projective capacitive screens, the transparent conductive layer is in the form of an
X–Y matrix pattern

• this creates a three dimensional (3D) electrostatic field

• when a finger touches the screen it disturbs the 3D electrostatic field allowing a
microcontroller to determine the coordinates of the point of contact

• this system works with bare fingers, stylus and thin surgical or cotton gloves; it also
allows multi-touch facility (for example, pinching or sliding)

11
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Infrared touch screens: Answers to Student’s Book

• infrared touch screens use a glass screen with an array of sensors and infrared
transmitters

• the sensors detect the infrared radiation; if any of the infrared beams are broken (for
example, with a finger touching the screen), the infrared radiation reaching the sensors is
reduced

• the sensor readings are sent to a microcontroller which calculates where the screen was
touched
Resistive touch screens:

• these screens are made up of two layers of electrically resistive material with a voltage
applied across them

• the upper layer is made of flexible polyethylene (a type of polymer) with a resistive
coating on one side

• the bottom layer is made of glass also with a resistive coating (usually indium tin
oxide) on one side

• these two layers are separated by air or an inert gas (such as argon)

• when the top polyethylene surface is touched, the two layers make contact • since both
layers are coated in a resistive material, a circuit is now completed which results in a flow
of electricity

• the point of contact is detected where there was a change in voltage

• a microcontroller converts the voltage (created when the two resistive layers touch) to
digital data which it then sends to the microprocessor
b i Uses organic layers which emit their own light and therefore there is no need for any
backlighting
ii • The plastic, organic layers of an OLED are thinner, lighter and more flexible than the
crystal structures used in LEDs or LCDs.

• The light-emitting layers of an OLED are lighter; OLED layers can be made from
plastic rather than the glass used in LED and LCD screens.

• OLEDs give a brighter light than LEDs.

• OLEDs do not require backlighting like LCD screens – OLEDs generate their own
light.

• Since OLEDs require no backlighting, they use much less power than LCD screens
(most of the LCD power is used to do the backlighting); this is very important in
battery-operated devices such as mobile phones.

• Since OLEDs are essentially plastics, they can be made into large, thin sheets (this
means they could be used on large advertising boards in airports, subways, and so
on).
• OLEDs have a very large field of view, about 170 degrees, which makes them
ideal for use in televisions and for advertising screens.

12
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

7 a touchscreen/concept keyboard/microphone/trackerball/touchpad
b headphones/speakers
c (removable) hard disk drive/SSD/USB drive/Blu-ray disk
d • QR code scanned using a camera on smartphone or tablet

• QR code is decoded/read using the app on the smartphone/tablet

• customer is provided with text about the animal

• customer is directed to a website about the animal

• QR code can be saved for future use


8 a input device which measures/takes readings from the surroundings/environment b •
moisture sensor:

• measures water content of the soil

• alerts Anna when soil is too dry/too wet

• maintains correct water level in the soil

• pH sensor:

• measures how acidic/alkaline the soil is

• alerts Anna when there may be something polluting the soil

• maintains correct pH level of the soil

• light sensor:

• measures brightness of the surroundings

• alerts Anna when fruit has too little/too much light

• temperature sensor:

• measures the temperature of the surroundings

• alerts Anna when it is too hot/too cold for optimum growing conditions

• gas/O2/CO2 sensor:
• measures amount of CO2 in the air

• alerts Anna if CO2 levels are too high/too low

• humidity sensor:

• measures the water content of the air

• alerts Anna if the air is too dry/too damp

• infrared sensor/motion sensor:

• measures infrared/microwaves

• detects intruders/wild animals

• pressure sensor:

• measures the weight of fruit fallen to the ground …

• … to alert Anna about how much fruit has fallen from the trees

13
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

9
Cambridge IGCSE and O Level Computer Science Teacher's Guide © David Watson and Helen Williams 2021
Answers to Student’s Book 14
Cambridge IGCSE™ and O Level Computer Science

Answers to Student’s Book


Exam-style questions and sample answers have been written by the authors. References to
assessment and/or assessment preparation are the publisher’s interpretation of the syllabus
requirements and may not fully reflect the approach of Cambridge Assessment International
Education. Cambridge International recommends that teachers consider using a range of teaching
and learning resources in preparing learners for assessment, based on their own professional
judgement of their students’ needs.
Cambridge Assessment International Education bears no responsibility for the example answers to
questions taken from its past question papers which are contained in this publication. The questions,
example answers, marks awarded and/or comments that appear in this digital material were written
by the author(s). In examination, the way marks would be awarded to answers like these may be
different.

4 Software
Answers to activities
4.1
Software System software Application software

Screensaver

Anti-virus software

Control and measurement software


Printer driver

Video editing software


Compiler

QR code reader

On-screen calculator

Operating system software


1
1
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

2 a buffer b • data sent to printer buffer


Answers to Student’s Book

• meanwhile, data from download/video buffer is sending data to video player • once printer
buffer is full, attention returned to video download and video buffer starts to fill again

• document starts to print

• when printer buffer is empty, an interrupt is sent to microprocessor requesting


more data

• microprocessor temporarily halts video download process to service printer •


more data is sent to the printer buffer

• meanwhile video player plays movie

• if video buffer is at minimum value, an interrupt is sent to stop other processes to allow
video buffer to start filling again

• process goes on until whole document is printed out

c interrupt sent to CPU indicating an error and message appears on screen; printing process
suspended until new black ink cartridge is installed
3 Human computer interface can be CLI or GUI; permits user to interact with computer
Multitasking allows computer to carry out several tasks at the same time (allocating resources
to each task)
Platform (to run software) all apps come under the control of OS; manages movement of data
into and out of RAM to allow software to run with
required resources
User account management allows more than one user to log onto a computer; each user is
allocated separate parts of memory; administrator has
overall control
Managing files carries out specific tasks (for example, create, open, close, delete, rename,
copy, etc.); maintains directory structures;
monitors access control mechanisms and ensures they are
maintained; loads files into memory as required
Hardware management involves management of all I/O devices; communicates with devices
via device drivers; ensures allocation of
resources according to priority; manages queues and buffers
Memory management manages RAM and keeps track of which apps are using memory
locations; prevents competing apps from using the
same memory locations
Interrupt handling handles interrupts from hardware and software to ensure they are serviced
in correct priority and that all devices
have access to the CPU and resources as required
System security ensures the integrity, confidentiality and availability of data is maintained; use
of passwords, maintaining access rights,
and so on

2
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

4 • A descriptor is a collection of information about devices.

• Descriptors include the vendor ID, product ID and serial number of a device.

• If a device doesn’t have a unique serial number associated with it, the OS will treat the
device as new every time it is plugged into a USB port.

• When a device is plugged in, descriptors are used to recognise the device and load the
device driver automatically.

5 a • when the computer is powered up, part of the OS needs to be loaded into RAM … • … this

is called the bootstrap (loader)

• start-up is handled by the BIOS …

• … which tells the computer where the storage device that hold the OS can be located •
BIOS is stored on firmware, such as EEPROM
b • BIOS settings are stored on a CMOS chip …

• … which is powered at all times by a battery on the motherboard

• user can change BIOS settings if required but not the BIOS software
6
3
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

4.2
True False

An assembler translates a high-level language program.


It is more difficult to write a program in a low-level language.


Java is an assembly language.


It is quicker to develop a program using a high-level language.


You always need a compiler to run a compiled program.


A program that is interpreted takes a longer time to run than


a compiled program. ✔
Low-level languages are machine dependent.

2 a • Auto-completion means that an IDE can automatically show the reserved words or variable
names that are available for use, so that the correct one can be picked from a list.

• Prettyprinting – code editors can colour code parts of a program, for example reserved
words or strings and automatically lay out the program in a meaningful way.

• Translators are supplied as part of the IDE; these can be compilers or interpreters or
both.
b A compiler translates the whole program written in a high-level language into machine
code program. An interpreter executes a program written in a high-level language by
translating then executing each line of the program.
A compiler can produce a file containing the translated machine-code program that can be
executed without the compiler, whereas an interpreter will always need to be present during
the execution of an interpreted program.
c Assembly language programs can be smaller in size and execute tasks more quickly as
fewer instructions are used, programs can also control specialist hardware using
appropriate simple commands.

4
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

Answers to exam-style questions Answers to Student’s Book

Answers to questions 6 and 7 in this section are example answers for past paper questions. The details of the
relevant past paper can be found with the corresponding exam-style question in the Student’s Book.

1 2

a virus scanner
b defragmentation
c security software
d screen saver
e device driver
3 a provide a platform for the execution of apps and also provides an HCI (human-computer
interface), memory management, security management and management of user accounts,
hardware management (e.g. keyboards and monitors), file management, handles interrupts,
manages multitasking (i.e. running more than one application at a time)
b memory management system which gives the impression that the RAM is larger than it is;
involves moving data into and out of RAM and HDD/SSD
c this occurs when large volumes of data are being moved in and out of HDD; involves a large
number of head movements
d program within the operating system that allows a user to run several applications at the
same time; but only one app is actually 'active' at any given time
e signal sent from a device or software to a processor to temporarily halt the process
currently being run

5
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

4 a Graphical user interface (GUI): Answers to Student’s Book

• uses pictures or symbols (icons) on screen to allow selection of options •

selection is done via pointing devices or using touchscreen technology •


common system is WIMP when pointing devices used

• Windows manager looks after the interaction between Windows, applications and
pointing devices/cursor position for touchscreen
Command line interface (CLI):

• user has to type in instructions/commands to choose options or launch apps •


user is in direct communication with the computer

• interface/input is via a keyboard and command box

• user needs to learn a number of commands

b and c
Interface Advantages Disadvantages

Graphical The user doesn’t need to learn This type of interface uses
user any commands. up considerably more
interface It is more user-friendly; icons are computer memory than a
(GUI) used to represent applications. CLI interface.
A pointing device (such as a mouse) is The user is limited to the
used to click on an icon to launch the icons provided on the
application – this is simpler than screen. It needs an
typing in commands OR a touch operating system, such as
screen can be used where applications Windows, to operate,
are chosen by simply touching the which uses up considerable
icon on the screen. memory.

Command The user is in direct The user needs to learn a


line communication with the number of commands to
interface computer. carry out basic operations.
(CLI) The user is not restricted to a All commands need to be
number of pre-determined options. typed in which takes time
It is possible to alter computer and can be error-prone.
configuration settings. Each command must be
It uses a small amount of typed in using the correct
computer memory. format, spelling, and so on.

6
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book
5 a C – an area in memory that temporarily holds data
b B – software that communicates with the operating system and translates data into a format that
can be printed out
c C – allocating memory to competing applications running on a computer system d D
– multitasking
e A – command line interface (CLI)
f C – a GUI interface makes it easier to use the computer
g C – interrupt
h D – CMOS
i A – any device plugged into the USB port of a computer must have a unique serial number j B –
post-WIMP interfaces make use of the more modern optical mouse to select icons 6 a • A compiler
produces a file containing a translated machine-code program; an interpreter does not.

• An interpreter executes a program written in a high-level language by translating then

executing each line of the program, provided there are no errors in that line. • A compiler
does not execute the program.
b Advantage – compiled programs are smaller in size; source code not included in compiled file.
Disadvantage – longer development time if compilers are used whilst developing code. c
Advantage – easier to edit programs during development. Disadvantage – programs cannot run
without the interpreter.
7 A compiler translates a high-level language into machine code, whilst an assembler translates a low-
level assembly language into machine code. One assembly language instruction usually translates
to one machine code instruction, whereas one high-level language instruction usually translates to
many machine code instructions.
8 a An Integrated Development Environment (IDE) is software that is used by programmers to aid the
writing, editing and development of programs.
b Auto-completion means that an IDE can automatically include matching keywords when the
first keyword is typed. For example, when IF is written in Visual Basic, the IDE
automatically adds the keywords: End If
Auto-correction means that an IDE can automatically correct errors, for example,
underlining the places where syntax errors occur and offering the corrected statement to
use.
Prettyprinting means colour-coding words and adjusting the layout of a program for
readability, for example, always showing reserved words in orange and strings in red. c • A
debugger to test a program in a controlled environment. For example, a separate report
window can be used to display the values of each variable as the program is running.

• A code editor to type the program and correct errors means that there is no need to exit the
IDE for every alteration during development.

7
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book
9 As the program has already been written it can be translated using a compiler as the development
has already been done. This means that there would be an executable program available in binary
that can be run on his friend’s computer without the use of any additional software. Pedro knows
that his friend’s internet connection is very slow, and the compiled program is smaller than the
original program so there will be less data to transmit, which means that it will take less time for
the program to arrive and the transmission is more likely to be successful.

8
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Cambridge IGCSE™ and O Level Computer Science
Answers to Student’s Book
Exam-style questions and sample answers have been written by the authors. References to
assessment and/or assessment preparation are the publisher’s interpretation of the syllabus
requirements and may not fully reflect the approach of Cambridge Assessment International
Education. Cambridge International recommends that teachers consider using a range of teaching
and learning resources in preparing learners for assessment, based on their own professional
judgement of their students’ needs.
Cambridge Assessment International Education bears no responsibility for the example answers to
questions taken from its past question papers which are contained in this publication. The questions,
example answers, marks awarded and/or comments that appear in this digital material were written
by the author(s). In examination, the way marks would be awarded to answers like these may be
different.

5 The internet and its uses


Answers to activities
5.1
1 a urlexample
b .co
c sample_page
d http
2 a Session cookie:

• temporary cookie

• ceases to exist once browser is closed or website session terminated

• doesn’t actually collect any information from user’s computer


Persistent cookie:

• stored on hard drive of user’s computer …

• … until expiry date reached or user deletes cookie

• remains in operation on user’s computer even when browser closed or website


session terminated
b • allows a website to remember a user’s email address and invoice details so these don’t have

to be typed in each time a user visits a website, which allows a faster log in • serves as a
memory, enabling a website to recognise users every time they visit the website

• saves user's items in a virtual shopping basket

• tracks internet habits and user’s website history/favourites (bookmarks)/


recommendations made

• stores customer payment details (in secure format)

• stores user preferences

• allows progress in online games/quizzes to be stored


1
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

• allows social networking sites to recognise certain preferences and browsing history •
allows different languages to be used on web pages automatically/personalised web pages
stored

• indicates if customer is new or returning

Feature Internet World Wide Web

It is possible to send and receive emails


Makes use of http protocols


Uses URLs to specify the locations of websites


and web pages ✔

Resources can be accessed by using web browsers


Makes use of TCP and IP


4 • they record data about the user …

• … such as browsing activity, purchases and preferences …

• … IP addresses and geographical location

• they store marketing data which allows adverts to target user

5.2

1a b
If block 4 is hacked and any data is changed, then the hash value for the block will change; this will result
in the chain being broken since block 5 can no longer point to block 4. 2 • cryptocurrency uses
cryptography to track transactions
• cryptocurrency is decentralised unlike digital currencies which are centralised • traditional digital

currencies are regulated by central banks and governments • unlike normal digital currencies,
cryptocurrency transactions are publicly available and can be tracked/money monitored

• cryptocurrency uses blockchaining

2
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

5.3
a b c
Three from:

brute force attacks to crack passwords make passwords difficult


to crack and change them
often

data interception tapping into networks to use private lines/networks


obtain information and encrypt all data

denial of service ‘… which cause it to crash use a malware checker,


attack firewalls and email filters

hacking illegal access to a firewalls and passwords


computer system (including biometrics)

malware (worms, deletion or altering of data use up-to-date anti-


viruses, spyware, …) malware software

phishing legitimate-looking emails don’t open links in emails, use


which contain links to fake up-to-date browsers, look out
websites for https, check if url looks
legitimate

pharming code on HDD/SSD or server use anti-virus software to


which redirects browser to detect website tampering,
fake website without user’s check
knowledge spelling of websites

social engineering cybercriminal creates social be aware of scam text


situation that can lead a messages, phone calls,
victim to dropping their memory sticks left lying
guard using: instant around on purpose, and so on
messaging, scareware,
phishing, baiting or phone
calls

2 • worm: type of stand-alone virus that can replicate itself with the intention of spreading to other

computers/networks; often uses networks to search out computers with weak security •
ransomware: programs that encrypt data on a user’s computer; a decryption key is sent back to
the user once they pay a sum of money (ransom); they are often sent via a Trojan horse or by
social engineering

• Trojan horse: malicious programs often disguised as legitimate-looking software; they replace
all or part of the legitimate software with the intent of carrying out some harm to the user’s
computer system
3
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

3 a i a date of birth – relatively easy to find or guess


ii too close to name of a pet – easy to crack
iii uses his own name in the password – makes it relatively easy to guess b ensure at least
eight characters are used, made up of upper-case and lower-case letters, numbers and other
keyboard characters; passwords should be changed on a regular basis c if the computer can be
accessed by other people, then it is not a good idea to store passwords on the computer itself since
these could be found by another user 5.4
1 a 25-May-2000 – weak password because it is just a date
b Pas5word – one of the ten most used passwords!
c ChapTer@06 – strong password with letters, numbers and other characters d
AbC*N55! – strong password with letters, numbers and other characters e
12345X – weak password since it is easy to guess/crack
2 a make use of levels of access; for example, level 1: passenger information, level 2:
airport staff, level 3: senior staff only – use passwords and user IDs b make use
of:

• strong passwords and user IDs

• firewalls

• scan for malware at all times

• don’t allow plug-in devices at information desks

• don’t allow internet access from information desks

5.5
1 a • as soon as motion detector recognises a person, a camera automatically photographs the face
of the person

• software scans face for key features and creates an electronic image/file • the file is

compared to the database containing face scans of authorised people • if key features
match database data then entry is allowed …

• … otherwise entry is denied

b finger/thumb print, voice recognition using a microphone

2 Benefits: Drawbacks:

• more secure system since only certain people can be • a person’s voice can be recorded to overcome the
recognised as authorised drivers security system

• safer since driver doesn’t need to look at screens/dials to • low accuracy; doesn’t understand verbal commands
select options or look at key data
• change of voice (e.g. due to a cold) can make
• relatively inexpensive technology recognition 'hit and miss'
commands to make system work
• sometimes there is a need to remember certain

4
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

5.6 f DNS
1 a two-step verification b proxy g biometrics
server h authentication
c privacy settings i social engineering j pharming
d SSL Answers to Student’s Book
e firewall

2 A browser requests an SSL/TLS digital certificate from the website it is trying to access. This is sent
from the web server to the user’s browser, containing a public key which can be used to
authenticate the website. Once the digital certificate is authenticated, the browser lets the web
server know, and secure communication can begin.
3 a Three from:

• Are there spelling or grammar errors?

• Does the email FROM address look like it is real?

• Is the domain name in the email address spelt correctly, or does it exactly match the real
company?

• Is the email addressed to you?

• Is there a clickable link? If so, what address does the link point to when you hover over it?
(DO NOT CLICK THE LINK!) It may not match the expected website.

• If it claims to be from a real company, log into your account with the company without
using the link.
b Three from:

• poor spelling and grammar

• not addressed to the user

• WW and Co does not look like a real company

• the email address which this is from does not look like a real or reputable company • there

is no further information in the email, such as details about the company itself • reputable
companies would not expect a customer to click on a link in an email to pay an account

• does not look professional

5
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

Answers to exam-style questions Answers to Student’s Book

1 a i A cookie is a small file stored on a user’s computer; they are sent by a website to a browser
when a user visits the site.
ii Session cookies are stored in a temporary memory on the computer; they don’t collect any
information from the user’s computer and don’t identify the user; they cease to exist when
the browser is closed or the user terminates the session with the website. Persistent cookies
are stored on the hard drive of the user’s computer; they remain stored until an expiry date is
reached or the user deletes the cookie; they remain in
operation on the user’s computer even when the browser is closed or the website
session has been terminated; they remove the need to type in login details every time a
website is visited.
iii Three from:

• allows a website to remember a user’s email address and invoice details so these
don’t have to be typed in each time a user visits a website, which allows a faster
log in

• serves as a memory, enabling a website to recognise users every time they visit the
website

• saves users items in a virtual shopping basket


• tracks internet habits and user’s website history/favourites (bookmarks)/
recommendations made

• stores user preferences

• allows progress in online games/quizzes to be stored

• allows social networking sites to recognise certain preferences and browsing


history

• allows different languages to be used on web pages automatically/personalised web


pages stored

• indicates if customer is new or returning

2 a • Spyware is software that gathers information by monitoring activity on a user's computer. It can
gather information by finding information such as bank account details and passwords
stored on the computer or within web browser cookies. Spyware called keyloggers can
record what a user types and which websites they visit. The gathered information is then
sent back to the person who created or sent the software, which can be used for
fraudulent purposes.

6
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

b Two step verification – extra security that means that even if passwords are stolen
criminals cannot gain access to the bank account. It requires some biometric
identification – this would limit access to specified employees only.
c • checks for any unusual network traffic and blocks access to the local network

• can be used to only allow specified external connections, so that all traffic is blocked apart
from these specified sites

• any known undesirable sites can be added to a list of blocked network sites d •
passwords/biometrics

• levels of access

• proxy servers

• physical security methods – e.g. PCS in locked rooms, etc.


3

7
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

4 a Order: C, E, A, B, D
b • student places finger on scanner

• map of fingerprints taken and converted to digital image

• data sent to a computer

• fingerprint map compared to those stored

• if recognised, the database is updated to show student present (including time and date
of entry)

• on leaving, the same process is carried out and the database is again updated to show the
date/time student left the school premises
5 a Four from:
• instant messaging – links embedded in messages to fake websites

• scareware – pop-up message claiming, for example, user’s computer is infected with a virus
and user downloads the fake virus checker

• emails/phishing – apparently genuine emails sent out which contain links to fake
websites

• baiting – cybercriminal leaves malware-infected memory stick so that it can be easily


'found'; once inserted into a computer, the malware is transferred

• phone calls – so-called IT professional calls a user on their mobile phone claiming their
device has been compromised and they are advised to download software which lets the
cybercriminal take over their device

b • Stage 1 – victim is identified and necessary information is gathered •

Stage 2 – victim is targeted by the chosen method

• Stage 3 – attack on victim takes place and information is gathered or disruption to their
system done

• Stage 4 – when cybercriminal has achieved their goal, all traces of the attack are
removed
c i digital currency exists purely in a digital format; there is no physical money (fiat
currency); digital currency involves electronic transfer of funds
ii if a hacker accessed a block and changed anything (for example, an amount of
money) …

• … the hash value of the block would change

• this means that all blocks beyond the hacked block would now be invalid because the
chain would be broken

• use of 'proof-of-work' is necessary before a block can be added to the chain … • …


thus preventing a hacker quickly creating a new block to complete the chain

8
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

6 a Used for layout of content – this structure is defined by HTML tags, e.g. for each heading and
paragraph text.
b browser
Internet Protocol address (IP address)
web server
Hypertext Markup Language (HTML)
7 a SSL is a security protocol:

• it encrypts any data that is sent

• it uses/sends digital certificates …

• … which are sent to the user’s browser …

• … that contains the gallery’s public key …

• … that can be used to authenticate the gallery

• once the digital certificate is authenticated, the transaction can begin

Statement True False


(✔) (✔)

Firewalls are only available as hardware devices


Firewalls allow a user to set rules for network traffic


Firewalls will automatically stop all malicious traffic


Firewalls only examine traffic entering a network


Firewalls encrypt all data that is transmitted around a network


Firewalls can be used to block access to certain websites


b
9
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Cambridge IGCSE™ and O Level Computer Science

Answers to Student’s Book


Exam-style questions and sample answers have been written by the authors. References to
assessment and/or assessment preparation are the publisher’s interpretation of the syllabus
requirements and may not fully reflect the approach of Cambridge Assessment International
Education. Cambridge International recommends that teachers consider using a range of teaching
and learning resources in preparing learners for assessment, based on their own professional
judgement of their students’ needs.
Cambridge Assessment International Education bears no responsibility for the example answers to
questions taken from its past question papers which are contained in this publication. The questions,
example answers, marks awarded and/or comments that appear in this digital material were written
by the author(s). In examination, the way marks would be awarded to answers like these may be
different.

6 Automated and emerging technologies


Answers to activities
6.1
a • sensors to detect the presence of a bottle are essential

• level sensors in mixing tank to ensure required volume maintained

• may be other sensors such as temperature and pH

• bottle arrives at bottling station

• sensor sends data back to central computer continuously

• if bottle is present, computer sends signal to actuator to open valve to allow liquid to
fill bottle

• level sensor used to check correct amount of liquid added

• once level sensor reading indicates bottle is full, a signal is sent to computer which then
sends a signal to an actuator to close the valve

• computer then sends signal to actuator to open valve and add measured amount of
carbon dioxide gas

• after two seconds, the gas valve is closed

• next empty bottle arrives and process continues

• bottle now moves to capping station

• again sensor detects bottle and computer sends signal to robot arm to place cap on
bottle and tighten it

• then robot arm retracts


• bottle moves to labelling station

• sensor detects bottle and computer sends signal to actuator to rotate table through 360°
as label is glued to bottle

• whole process is continuous


b Advantages:

• faster than a human operator to take any necessary action

1
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

• more consistent – each bottle will have almost exactly the same amount of each
ingredient

• less expensive over time as it can replace most of the workforce who would need to
monitor the process 24 hours a day

• less wastage and more efficient use of materials

• higher productivity
Disadvantages:

• expensive to set up

• needs considerable testing

• possible for a set of conditions to occur that were never considered during testing •

automated systems always need enhanced maintenance which can be expensive • any
computerised system is subject to cyberattacks
6.2

• needs camera to pick up parallel lines in parking spot

• extra data needs to be width and length of gap (infrared and ultrasonic sensors can be used to
find these values)

• data needs to indicate that no vehicle is already in the parking space

• parallel parking will use cameras which will search out white (parallel) lines and ensure that
the distance between vehicle and white lines is consistent
6.3

• the computer takes readings from sensors in the car's front bumper …

• … to calculate the distance between the car and the vehicle in front

• the computer takes additional sensor readings to determine the speed of the car • the
computer calculates required safe braking distance

• data from the (given) table is then used and the computer determines if the calculated
braking distance is greater than the data in the table ….

• … if braking distance is greater than safe distance (in table) then brakes are applied and
accelerator/throttle also reduced and warning signal/light produced

• if distance between vehicles is OK then no action taken

6.4
Students should produce a table showing all the advantages and disadvantages of using an
automated weather station. This will require research using the internet or a local weather station
(if it exists). No answer has been supplied because this answer will vary from country to country
and students will need to make their own judgements.
6.5
1 • data gathered automatically from various locations around the world …

• … could all be collated over time and patterns of global weather changes
automatically generated

• automatic projection of key weather data into the future to predict weather could then be
checked for its accuracy (by comparison of predicted weather with ACTUAL weather)

2
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

• results of this comparison would allow the climate change model to be modified 2 •
three sensors needed: temperature, light and moisture

• all three sensors send data continuously to a microprocessor

• data would need to be converted to digital (using ADC) if necessary

• if temperature readings < pre-set value, the microprocessor sends a signal to the
actuators …

• … to switch on the heating system/close the windows

• if temperature readings >= pre-set value, the microprocessor sends a signal to the
actuators …

• … to operate motors to open windows (and switch off heaters)

• if light level readings < pre-set value, the microprocessor sends a signal to the actuators … • …
to operate motors to open blinds (and turn on artificial lighting)

• if light level readings >= pre-set value, the microprocessor sends a signal to the
actuators …

• … to operate motors to close blinds (and turn off artificial lighting)


• if moisture level readings < pre-set value, the microprocessor sends a signal to the
actuators …

• … to switch on water pump to irrigate soil

• if moisture level readings >= pre-set value, the microprocessor sends signals to the
actuators …

• … to switch off water pumps

• process is continuous

3 • cameras read road signs (60 kph) and software converts the images into a text file • …

which allows the microprocessor to interpret road signs

• if the car’s speed > 60 kph, the microprocessor sends a signal to the actuators … • …

to operate motors to apply the brakes and/or reduce throttle position • if the car’s speed

< 60 kph, the microprocessor sends a signal to the actuators … • … to operate motors
to increase throttle position

• sensors in the car’s bumpers/fenders will ensure a safe distance between car and vehicle in front
is maintained (by applying brakes and altering throttle as necessary)

• the Sat Nav calculates the car’s position on a map

• data is sent to a central computer which checks optimum driving conditions • if present driving is
not the same as stored driving parameters, then computer sends signals to actuators to change
gears and apply brakes as necessary
4 Parts i and ii
Step 1

3
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

A sensor detects a vehicle and sends a signal to instruct a camera to capture an image of the
front of the vehicle (often an infrared camera is used to give a clearer image and for use at
night).
Step 2
a An algorithm is used to locate and isolate the number plate from the image taken by the
camera. This algorithm also takes into account the size of the number plate and any
damage or orientation.
b
c Each character is then recognised using optical character recognition (OCR) software. The
characters are converted into a string of editable text by the software.
d This text string is then stored on a database.
Step 3
Once all of this has happened, the car park barrier is raised and the motorist is issued with a
ticket. The ticket shows the date and time of entering the car park.
Step 4
When the motorist returns to the car park, they insert their ticket into a machine which calculates
the car park charges. The payment is registered on the database. The motorist then drives to the
exit barrier and the ANPR system again reads the number plate and checks its database. If the
number plate is recognised (and payment made), the exit barrier is raised.
iii Advantages:

• no need to employ car park security guards which saves money

• much faster system than having to check a ticket at the exit; car parks can issue tickets on
entry, but this ticket is simply used for payment purposes by the motorist before leaving
the car park and isn’t used at the exit since payment will now be linked to the number
plate on the car

• can be used to automatically control the entry and exit to a car park or private roads

• can be used as a security system; preventing illegal parking and preventing


unauthorised access to private car parks
Disadvantages:

• there is a lack of manned security car park surveillance which could lead to vandalism (and
other crimes) since nobody is checking on a regular basis; CCTV is often used, but this
is often just used 'after the event'

• invasion of privacy issues due to the recording of driver’s number plates •


damaged or very dirty number plates won’t be recognised by the system

• number plate cloning; the ANPR system only recognises the number plate and not the car,
so it is possible for a car to be fitted with a cloned number plate thus by-passing car park
security, for example

4
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

6.6
Each student should produce a presentation in the form of a table which highlights the advantages
and disadvantages of immersive games consoles. The table should include research into which
sensors are used (for example, accelerometers, proximity, magnetic field and pressure), together with
a description of the function of each sensor identified. 6.7
1 a i flow sensors, temperature sensors
ii light sensors, infrared/motion sensors
iii infrared/motion sensors, cameras, pressure sensors
b i Advantages, two from:

• faster response to non-optimum conditions

• more precise monitoring

• greater consistency of product(s)

• 24/7 monitoring
Disadvantages:

• expensive to set up initially and to maintain

• may not respond well to unusual conditions

ii Advantages, two from:


• saves money on unnecessary lighting

• completely automated system

• better control of lighting


Disadvantages, two from:

• expensive to set up

• needs expertise to program the lights exactly as required

• may require specialist equipment

iii Advantages, two from:

• much safer

• fewer staff needed

• fewer delays caused by people pulling emergency cord if someone has an item
stuck in the door
Disadvantages, two from:

• still requires human monitoring

• expensive to set up and implement

• requires extensive testing to make sure it works


5
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book
Statement True False

Automated systems lead to less consistent results or less


consistent products ✔

Automated systems are more expensive to set up than traditional


manual systems ✔

Automated systems would be quickly overwhelmed by the amount of


data presented to it ✔

Automated systems are inherently less safe than manual systems


Automated systems generally require enhanced maintenance when


compared to manual systems ✔

Automated systems allow processes to run at optimum conditions at


all times ✔

Software failures, due to unforeseen conditions, are unlikely to impact


on an automated system ✔

Automated systems will react more quickly to unusual



process conditions

6.8
Students to produce a table showing all the advantages and disadvantages of the use of robots in
agriculture. This may involve research using:

• the chapters in this book

• the companion Information and Communication Technology (ICT) book • the


internet.
Typical advantages might include:

• more accurate

• much faster

• less waste (i.e. picking fruit before it is ripe)

• can work 24 hours a day


Typical disadvantages might include:

• expensive to implement

• will take lots of time to train or program to complete tasks successfully

• different conditions or plants may require more retraining, casual workers will lose their
work

6
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

6.9
1 Examples:

• harvesting/picking of vegetables and fruit

• weed control

• phenotyping (plant growth and health)

• seed-planting and fertiliser distribution

• autonomous labour-saving devices


Harvesting and picking:

• robots have been designed to do this labour-intensive work; they are more accurate (only
picking ripe fruit, for example) and much faster at harvesting

• for the reasons above, this leads to higher yields and reduces waste – for example, Vegebot
(Cambridge University) uses cameras to scan, for example, a lettuce and decide whether or
not it is ready to be harvested
• a second camera in Vegebot (near the cutting blades) guides an arm to remove the lettuce from
its stalk with no damage.
Weed control:

• weed management robots can distinguish between a weed and crop using AI • examples of
weed control robots are being used in France (by Mouton Rothschild) to remove weeds
between grape vines in their vineyards; this saves considerably on labour costs and improves
vine growth

• weed control robots use GPS tracking to stay on course to move along the rows of vines and
remove the weeds; a weed removal blade is operated by an actuator under the control of the
controller (microprocessor) in the robot

• very often a drone (flying robot) is used first to do an aerial view of the vineyard, so that a
programmed course of action can be produced, which is then sent to the weed control robot’s
memory.
Phenotyping:

• phenotyping is the process of observing physical characteristics of a plant in order to assess its
health and growth

• robots designed to do phenotyping are equipped with sensors (including spectral sensors and
thermal cameras) that can create a 3D image/model of the plant, thus allowing it to be
monitored for health and growth

• machine learning is used to recognise any issues with leaves (for example, if they have a
blight or have the wrong colour) so that the robot can convey this back to the farmer

• these robots are much more accurate and faster at predicting problems than when done
manually.

7
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

Seed-planting and fertiliser distribution: Answers to Student’s Book

• drones (flying robots) can produce an aerial image of a farm sending back a 'bird's eye
view' of the crops and land

• they allow seed-planting to be done far more accurately


• they also allow for more efficient fertiliser-spreading to reduce waste and improve
coverage (this is much more efficient than conventional crop spraying)

• drones can also be used in cloud seeding where the drone can add silver iodide crystals to a
cloud forcing it to give up its rainwater

• the drones use a very complex camera system to target seeding and allow fertiliser spraying
Autonomous labour-saving devices:
Several of the devices described above could be referred to as autonomous. The following list

summarises some of the devices which can work independently of humans: • grass
mowers/cutters

• weeding, pruning and harvesting robots

• seeding robots

• fertiliser spraying

• All of these devices use sensors and cameras to go around obstacles, or they can even be
programmed to 'go to sleep' if the weather turns bad.

6.10
Essay produced by student on robotics in entertainment including their advantages and
disadvantages.

8
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

6.11
Advantages Disadvantages
• robots are capable of working in • robots can find it difficult to do 'non
conditions which may be standard' tasks (for example,
hazardous windscreen being fitted to a car
to humans is cracked)

• robots work 24/7 without the need to stop • robots can lead to higher
unemployment amongst manual
• robots are less expensive in the long run labourers

(since there will be fewer salaries to pay) • • there is a risk of deskilling when
robots are more productive than humans robots take over certain tasks (for
(higher productivity) example, welding and paint spraying)

• although not necessarily more accurate, • factories can now be moved to


robots are more consistent anywhere in the world where
operation costs are lower
• robots are better suited to boring, (leading again to unemployment
repetitive tasks than humans in some
(therefore less likely to make countries)
mistakes)
• robots are expensive to buy and set up
• there will be less cost in heating and in the first place
lighting (robots don’t need good
light or warmth)

2 Ability to sense its surroundings – two from:

• sensors gather data from surroundings

• allowing robot to recognise its immediate surroundings …

• … giving it the ability to determine size, shape, weight, etc.


Ability to move in some way – two from:
• make use of wheels, cogs, pistons, gears, etc. to carry out turning, twisting, moving,
gripping, lifting, etc.

• mechanical structures made up of motors, hydraulic pipes, actuators and circuit boards •
makes use of electronic components

• uses end-effectors to carry out different tasks


A perceived intelligence:

• have a controller which determines the action to be taken to perform a task •


controllers can be programmed to allow the robot to do certain tasks
3 autonomous
sensors
cameras
actuators
light detecting and ranging/radar and ultrasonics
lasers

9
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

4 sensors
microprocessor
environment
end-effectors
controller
programs
repetitive
adaptive
5 a • sensors can use radar/sonar to detect objects under the sea

• cameras take images which allow device to be recognised

• if ship recognised, then microprocessor sends signals to actuators to operate


digital cameras

• actuators also used to operate electric motors in undersea robots to allow them to move
around the shipwreck
b i • sensors can be used to recognise samples

• data sent to microprocessor after digital conversion (using ADC)

• if rock samples recognised, microprocessor sends signals to actuators to … • …


stop robot’s motors
• … to operate 'claws' to take samples of rock

ii camera used to recognise terrain, recognise potential rock samples and to allow
manoeuvring safely
c Advantages include:

• harsh environment which is dangerous to humans

• more precise than humans

• can operate non-stop

• no need for any humans to be present (useful on long journeys, such as visit to Mars
which takes several years)
Disadvantages include:

• expensive devices to design, test and manufacture

• difficult to repair such devices remotely if they break down

• as with any robot, they are limited to the functions programmed in (although some ability
to reprogram will exits – they may not have the necessary attachments to carry out a
newly required task)
d Could be used in defusing bombs, clean-up operations in nuclear plants (for example,
Chernobyl), etc.
6.12
a knowledge base
b explanation system
c expert system shell
d robotics
e rules base

10
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

6.13
1 artificial intelligence
cognitive
expert systems
explanation system
inference engine
search engine
inference rules
2 a • Is there anything showing on the screen?

• Can sound be heard through internal loud speakers?

• If external speakers are plugged into another computer, do they work? •


Are the connections between the speakers and the computer OK? (or any
series of logical questions)
b • oil and mineral prospecting

• diagnosis of patient’s illness

• tax and financial calculations

• strategy games, such as chess

• logistics (parcel deliveries)

• identification of plants, animals and chemicals (for example)

3 a • sub-set of AI

• algorithms are trained and learn from past experiences and examples • offer fast

and accurate outcomes due to very powerful processing capability • ability to

manage and analyse considerable volumes of complex data • machines learn


through data acquisition to solve problems

• can make decisions without being programmed to do so

AI Machine learning

represents simulated intelligence this is the practice of getting a machine


in machines to make decisions without being
programmed to do so

the aim is to build machines which the aim is to make machines that learn
are capable of thinking like humans through data acquisition, so that they
can solve new problems

c • use web scraping to find key data in websites (search bots)

• redundant data (collaboration filtering) removed

• relationship between key words typed in and key words following collaboration
filtering is used to train the model

• these searches are evaluated to further refine the search engine model

11
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

4
Answers to exam-style questions
1 a Advantages:

• robots don’t need good lighting or working temperatures

• robots can work 24/7

• lower wage bill in the long term

• higher productivity

• fewer errors made

• leaves humans to do more skilled work


Disadvantages:

• expensive to maintain and repair

• expensive to set up initially

• need to pay redundancy money to workers

b • sensors (proximity) to detect presence of humans


• on sensing a human, the robot will automatically stop its activity

• verbal warning made by robot to indicate its presence

12
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

2 • accelerometers

• to measure and respond to tilting of device

• to respond to forward/backward and side-to-side movement

• proximity sensors

• used in smart touch pads …

• … to detect hand/finger positions

• embedded accelerometers and other sensors in game consoles

• allow increased human interaction with the game …

• … giving a more immersive games experience

3 a • data from proximity sensor compared to pre-set value

• pre-set value shows minimum distance

• if sensor value is the same/lower

• then the microprocessor sends a signal to actuators to stop the robot

• if sensor value higher

• then no action is taken

• whole process is continuous

b i • light sensors in offices

• light sensors and infrared/motion sensors in offices and corridors

• if a person is detected entering an office or corridor, a signal is sent by


microprocessor to turn on the lights

• if light sensor value < stored value for office the microprocessor sends signal to turn
on lights
ii Advantages:

• less expensive, because lights only on when office or corridor occupied

• longer bulb life because switched on for less time


• possible to program light displays if required
Disadvantages:

• expensive to set up initially

• will require more maintenance than a manual system

13
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

4a Answers to Student’s Book


Task Control Monitor Expe
rt
syste
m

automatic control of the atmosphere in a large greenhouse


(to ensure ideal growing conditions) ✔

self-parking system in a car


playing a strategy game, such as chess


an automatic weather station sending data to pilots flying


near an airport ✔

a 24/7 check on patients in an intensive care unit


of a hospital ✔

automatic system used to diagnose the illness of a patient


automatic closing and opening of the doors on a train


fault identification in electronic devices together


with suggested actions to rectify the fault ✔

b Four from:

• explanation system informs user of the expert system’s reasoning behind its
conclusions and recommendations
• inference engine is a type of search engine used in an expert system that examines the
knowledge base for information that matches the queries

• knowledge base is a repository of facts which contain all the knowledge of the expert
system; it is composed of a collection of objects and attributes

• rules base is a collection of inference rules used to draw conclusions, based on inputs

• user interface is a method whereby the expert system interacts with the user; the
interaction can be through dialogue boxes or command prompts; questions are often
simple Yes/No responses and are based on responses to previous questions
5 a • sensors (infrared, pressure) indicate the presence of a person trying to leave/enter the train

• cameras can also be used to check that nobody is trapped in the doors

• sensors send data back to a microprocessor …

• … after being converted to digital (using an ADC)

• camera data is put through an algorithm which determines if a person is trapped in a


door

• if camera or sensor data indicate a trapped person …

• … a signal is sent to actuators to operate motors to open doors/halt the closing of doors • if
sensors and camera detect no presence of passenger in door area, …

• … signals are sent to actuators to operate motors to close doors

• the train is then able to move

14
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

b • can be fully automatic/no need to manually check every door

• it is safer since no one can get trapped and train can’t move off …

• … until all sensors indicate no passenger presence

• faster response to 'dangerous' situations

c • allows driver to make a manual check on whether it is safe to move off (a double safety
check)

• gives passengers confidence if they know there is a manual back-up safety system d i
autonomous means driverless, no human operators
ii Sensors:

• cameras to recognise signals on the track

• radar and ultrasonics to sense the environment and build up a 3D picture of


surroundings

• use of LiDaR, laser systems and GPS to track position


Actuators:

• to apply brakes to stop train

• to operate accelerator to control speed of train

• to open and close doors

Advantages of autonomous trains Disadvantages of autonomous trains

improves the punctuality of the trains ever-present fear of hacking into


the vehicle’s control system

reduced running costs (fewer staff system doesn’t work well with very
are required) busy services (at the moment)

improves safety because human high capital costs and operational


error is removed costs initially (that is, buying the
trains, expensive signalling and
control
equipment and the need to train staff)

minimises energy consumption since ensuring passenger behaviour is


there is better control of speed and an acceptable particularly during busy
optimum service requires less energy times (for example, jamming doors
(trains stuck in stations still use open on trains, standing too near the
energy) edge of platforms, and so on)

possible to increase the frequency passenger reluctance of the new


of trains (automated systems allow technology
for shorter times between trains)

easier to change train scheduling (for no drivers mean there will be a need
example, more trains during busier for CCTV to monitor railway stations
times)

iii
15
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

6 a Ability to sense their surroundings: Answers to Student’s Book

• this is done via sensors (such as light, pressure, temperature, acoustic, and so on)

• sensors allow a robot to recognise its immediate environment and gives it the ability to
determine things like size, shape or weight of an object, detect if something is hot or
cold, and so on; all sensor data is sent to a microprocessor or computer
Have a degree of movement:

• they can make use of wheels, cogs, pistons, gears (etc.) to carry out functions such as
turning, twisting, moving backwards/forwards, gripping or lifting

• they are mechanical structures made up of many parts (for example, motors, hydraulic
pipes, actuators and circuit boards)

• they contain many electrical components to allow them to function

• can make use of end effectors (different attachments to allow them to carry out specific tasks
such as welding, spraying, cutting or lifting)
Apparent intelligence:

• they have a 'brain' known as a controller which determines the action to be taken to
perform a certain task (the controller relies on data sent from sensors or cameras, for
example)
b Independent robots:

• have no direct human control (they are said to be autonomous; for example, an
autonomous vehicle)

• can replace the human activity totally (no human interaction is required for the robot to
function fully)
Dependent robots:

• have a human interfacing directly with the robot (the human interface may be a
computer or a control panel)

• can supplement, rather than totally replace, the human activity (for example, in a car
assembly plant where both humans and robots work together to produce a car)
16
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

7 8 a end effector

b inference engine
c autonomous
d machine learning
e automated systems
f artificial intelligence
g chatbots
h search bot/web crawler
i robotics
j cognitive
k attributes
l knowledge base
m drone
n controller
o inference rules

Cambridge IGCSE and O Level Computer Science Teacher's Guide © David Watson and Helen Williams 2021
Answers to Student’s Book 17
Cambridge IGCSE™ and O Level Computer Science

Answers to Student’s Book


Exam-style questions and sample answers have been written by the authors. References to
assessment and/or assessment preparation are the publisher’s interpretation of the syllabus
requirements and may not fully reflect the approach of Cambridge Assessment International
Education. Cambridge International recommends that teachers consider using a range of teaching
and learning resources in preparing learners for assessment, based on their own professional
judgement of their students’ needs.
Cambridge Assessment International Education bears no responsibility for the example answers to
questions taken from its past question papers which are contained in this publication. The questions,
example answers, marks awarded and/or comments that appear in this digital material were written
by the author(s). In examination, the way marks would be awarded to answers like these may be
different.

7 Algorithm design and problem solving


Answers to activities
7.1
For example, for a step tracking app:

• Input a 3-axis accelerometer senses my steps

• Process totals the steps for each day

• Output the total number of steps taken so far

• Storage the number of steps taken each day

7.2

7.3
Amount 100
TotalPrice 350
Discount 0.2
FinalPrice 280
Name "Nikki"
Message "Hello Nikki"
7.4
OUTPUT "Please enter a mark "
INPUT Mark

1
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

IF Mark < 0 OR Mark > 20


THEN
OUTPUT "Invalid Mark"
ELSE
IF Mark > 9
THEN
OUTPUT "Pass"
ELSE
OUTPUT "Fail"
ENDIF
ENDIF
7.5
CASE OF Day
1 : OUTPUT "Sunday"
2 : OUTPUT "Monday"
3 : OUTPUT "Tuesday"
4 : OUTPUT "Wednesday"
5 : OUTPUT "Thursday"
6 : OUTPUT "Friday"
7 : OUTPUT "Saturday"
OTHERWISE OUTPUT "Error in day number"
ENDCASE
7.6
Purpose: Display the largest number
Processes:

• Input two numbers

• Compare the two numbers

• Display the largest number with a suitable message


Output if 7 and 18 input: 18 is the largest
7.7
1 Telephone number – presence check (to ensure something is entered), length check (to check the
number is not too long or short), or format check (to make sure number matches the style of
national telephone numbers).
Pupil's name – presence check (to ensure something is entered) and length check (i.e. between 2
and 30 letters, to check the name is of a reasonable length).
Part number – presence check (to ensure something is entered) and format check (to make sure
data matches the character/number style XXX999).
2 OUTPUT "Please enter age of child "
INPUT ChildAge
OUTPUT "Please enter height of child in centimetres"
INPUT ChildHeight
2
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

IF ChildAge < 8 OR ChildAge > 11 OR ChildHeight < 110 OR


ChildHeight > 150
THEN
IF ChildAge < 8
THEN
OUTPUT "Too young"
ENDIF
IF ChildAge > 11
THEN
OUTPUT "Too old"
ENDIF
IF ChildHeight < 110
THEN
OUTPUT "Too small"
ENDIF
IF ChildHeight > 150
THEN
OUTPUT "Too tall"
ENDIF
ELSE
OUTPUT "Child can ride"
ENDIF
3 OUTPUT "Please enter your password "
REPEAT
INPUT Password
IF LENGTH(Password) > 12 OR LENGTH(Password) < 8
THEN
IF LENGTH(Password) > 12
THEN
OUTPUT "Password is too long, please re-enter " ELSE
OUTPUT "Password is too short, please re-enter " ENDIF
ENDIF
UNTIL LENGTH(Password) <= 12 AND LENGTH(Password) >= 8

3
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

7.8
Telephone number – the number needs to be the one that is required as well as having the
necessary characteristics.
Pupil's name – the name needs to be the one that is associated with the pupil. Part number – a
part number could have the required format but not be for the part intended. 7.9
For example:
Normal test data: 7, 34, 55, 67, 74, 83, 21, 45, 72, 64; Expected result: 54.2
(Other values acceptable.)

7.10
For example:
Erroneous test data: −7, 1001; Expected result: both values rejected
(Other values acceptable.)
7.11
1 Boundary test data for 100 is: 100, 101; Expected result: 100 accepted, 101 rejected 2
Normal test data: 2, 14, 15, 6, 7, 13, 20, 4, 10, 9; Expected result: 10
Normal test data: 17, 13, 15, 15, 14, 16, 2, 8, 7, 6; Expected result: 11.3
Erroneous test data: −7, 23; Expected result: both values rejected
Boundary test data: −1, 0 and 20, 21
Expected results: −1 rejected, 0 accepted and 20 accepted, 21 rejected
7.12
Answer in chapter (page 285).

4
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

7.13
A B C X OUTPUT

0 0 100 Enter your ten values

1 4 4 4

2 8 8

3 19 19

4 17

5 3 3

6 11

7 6

8 1 1

9 13

10 9 19 1

5
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

7.14
First Last Index Swap Temp Temperature

[1] [2] [3] [4] [5] [6] [7] [8]


1 8 1 FALSE 35 31 32 36 39 37 42 38

TRUE 35 31 35

2 TRUE 35 32 35

5 39 39 37 39

7 42 38 42
7 1 FALSE

6 TRUE 39 38 39

6 1 FALSE

6
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

7.15
Sample data: −1, −7, −11, −19, −3, −20, −9, −4, −6, −8
A B C X OUTPUT

0 0 100

1 -1

2 -7 -7

3 -11 -11

4 -19 -19

5 -3

6 -20 -20

7 -9

8 -4

9 -6

10 0 -3
0 -20

The highest value is −1 not zero.


7.16
−1000001(or any number less than this) and 1000001(or any number
greater than this) will fail. 7.17

A ←0
OUTPUT "Enter your ten values"
INPUT X

B ←X

C ←X
REPEAT
INPUT X
IF X > B
THEN

B ←X
ENDIF
IF X < C
THEN

C ←X
ENDIF

A ←A + 1
UNTIL A = 9
OUTPUT B, C

7
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book
A B C X OUTPUT

0 -97 -97 -97

1 12390 12390

2 0

3 77

4 359

5 -2

6 -89

7 5000

8 21

9 67

12390,-97
7.18
0, 26
Expected results rejected – erroneous data
1, 25
Expected results: Your tickets cost 20
Your tickets cost 400 – extreme data
9, 10
Expected results: Your tickets cost 180
Your tickets cost 180 – normal data
19, 20
Expected results: Your tickets cost 342
Your tickets cost 320 – normal data
Extra test data:
0, 1
Expected results: 0 rejected
1 Your tickets cost 20 – boundary data lower bound
26, 25
Expected results: 26 rejected
25 Your tickets cost 400 – boundary data upper bound
-30, 200
Expected results rejected – erroneous data

8
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

7.19
1 Change FOR Test ←1 to 4 // outer loop for the tests to
FOR Test ←1 to 2 // outer loop for the tests
remove 3 : SubjectName ← "English" and 4 : SubjectName ← "IT"

change FOR StudentNumber ←1 TO 600


to FOR StudentNumber ←1 TO 5

change SubjectAverage ← SubjectTotal / 600


to SubjectAverage ← SubjectTotal / 5
change OverallAverage ← OverallTotal / 2400
to OverallAverage ← OverallTotal / 10
The code should now look like this:
// initialisation of overall counters
OverallHighest ← 0
OverallLowest ← 100

OverallTotal ← 0

FOR Test ← 1 to 2 // outer loop for the tests


// initialisation of subject counters
SubjectHighest ← 0

SubjectLowest ← 100

SubjectTotal ← 0
CASE OF Test
1 : SubjectName ← "Maths"

2 : SubjectName ← "Science"
ENDCASE
FOR StudentNumber ← 1 TO 5 // inner loop for the students
REPEAT
OUTPUT "Enter Student", StudentNumber, "’s mark for ", SubjectName INPUT
Mark
UNTIL Mark < 101 AND Mark > -1
IF Mark < OverallLowest THEN OverallLowest ← Mark

IF Mark < SubjectLowest THEN SubjectLowest ← Mark

IF Mark > OverallHighest THEN OverallHighest ← Mark

IF Mark > SubjectHighest THEN SubjectHighest ← Mark

OverallTotal ← OverallTotal + Mark

SubjectTotal ← SubjectTotal + Mark


NEXT StudentNumber
SubjectAverage ← SubjectTotal / 5
OUTPUT SubjectName
OUTPUT "Average mark is ", SubjectAverage
OUTPUT "Highest Mark is ", SubjectHighest
OUTPUT "Lowest Mark is ", SubjectLowest
NEXT Test
OverallAverage ← OverallTotal / 10
OUTPUT "Overall Average is ", OverallAverage
OUTPUT "Overall Highest Mark is ", OverallHighest
OUTPUT "Overall Lowest Mark is ", OverallLowest

Test data (sample – yours might be different): 1, 99, −1, 101, 20, 80, 30, 70, 40,
60, 50, 50

9
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

2 Trace table:
Tes Stude Mar Subje Subject Overall Output
t nt k ct
Numb Name Av High Low Total Av High Low Total
er
0 100 0

1 0 100 0
1 1 1 1 1 1 1 1 Enter student
1’s mark for
Maths
2 99 99 100 99 100 Enter student
2’s mark for
Maths
3 -1 Enter student
3’s mark for
Maths
101 Enter student
3’s mark for
Maths
20 120 120 Enter student
3’s mark for
Maths
4 80 200 200 Enter student
4’s mark for
Maths
5 30 230 230 Enter student
5’s mark for
Maths
46 Maths
Average mark is
46 Highest mark
is 99 Lowest
mark is 1

2 0 100 0

1 70 70 70 70 300 Enter student


1’s mark for
English
2 40 40 110 340 Enter student
2’s mark for
English
3 60 60 170 400 Enter student
3’s mark for
English
4 50 50 220 450 Enter student
4’s mark for
English
5 50 50 270 500 Enter student
5’s mark for
English
54 English
Average mark is
54 Highest mark
is 70 Lowest
mark is 40
50 Overall average
mark is 50
Overall highest
mark is 99
Overall lowest
mark is 1

10
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

7.20
1 Total ←0

FOR Counter ← 1 TO 10

REPEAT
OUTPUT "Enter positive number "
INPUT Number
UNTIL Number > 0

Total ← Total + Number

NEXT Counter

Average ← Total / 10

OUTPUT "Average is ", Average


OUTPUT "Total is ", Total

2 Total ←0

Counter ← 0

REPEAT
REPEAT
OUTPUT "Enter positive number, -1 to finish "
INPUT Number
UNTIL Number > 0 OR Number = -1
IF Number <> -1
THEN

Total ← Total + Number

Counter ← Counter + 1

ENDIF
UNTIL Number = -1

Average ← Total / Counter


OUTPUT "Average is ", Average
OUTPUT "Total is ", Total
3 For 1, I chose a FOR … NEXT loop because it has a fixed number of iterations. For 2, I chose a
REPEAT … UNTIL loop because there must be at least one number in the list but the number of
iterations is unknown.

Answers to exam-style questions


Answers to questions 8 and 9 in this section are example answers for past paper questions. The details of the
relevant past paper can be found with the corresponding exam-style question in the Student’s Book.
1 • Inputs – the data used by the system that needs to be entered while the system is active

• Processes – the tasks that need to be performed using the input data and any other
previously stored data

• Outputs – information that needs to be displayed or printed for the users of the system •
Storage – data that needs to be stored in files on an appropriate media for use in the future

11
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

2
3 a Diners – range check 2 to 12 inclusive, presence check and type check of integer Bill –
range check 10 to 500 inclusive, presence check and type check of real b Test data
(sample – yours might be different):

• Normal data: 5 diners and a bill of $90.00


Expected result: $18.00

• Normal data: 8 diners and a bill of $69.00


Expected result: $8.63
c Test data (sample – yours might be different):

• Abnormal data: 15 diners and a bill of $5.00


Expected result: both values rejected
d • Boundary data for lower bounds 1 diner and 2 diners and bills of $9.99 and $10.00
Expected result: 1 and $9.99 both values rejected, 2 and $10.00 $5.00

• Boundary data for upper bounds 12 diners and 13 diners and bills of $500.00 and
$500.01
Expected result: 13 and $500.01 both values rejected, 12 and $500.00 $41.67 4
Validation – the automated checking by a program that data is reasonable before it is accepted into a
computer system
Verification – checking that data has been accurately copied from another source and input into a
computer or transferred from one part of a computer system to another
5 Name:
Validation checks:

• presence to ensure name is entered

• length check to ensure there are not too many letters


Verification check – yes to ensure that the name entered is the one intended and there are no
typing errors

12
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

Date of birth:
Validation checks:

• presence to ensure date of birth is entered

• format check to ensure that all the components of the data are in range •
range check to ensure that the value for the date is realistic
Verification check – yes to ensure that the date entered is the one intended and there are no
typing errors
Password:
Validation checks:

• presence to ensure password is entered

• length check to ensure there are the appropriate number of characters •


format check for any special rules, for example at least one digit
Verification check – yes to ensure that the password entered is the one intended and there are no
typing errors
Phone number:
Validation checks:

• presence to ensure phone number is entered

• length check to ensure there are the appropriate number of digits/characters •


format check for any special rules, for example must start with +44
Verification check – yes to ensure that the phone number entered is the one intended and there
are no typing errors
6a
Counter Accept Reject Length Breadth Size OUTPUT

0 0 0
1 1 15 10 150

2 2 20 17 340

3 1 32 10

4 2 30 35

5 3 30 15 450

6 3 30 28 840

7 4 25 25 625

8 4 20 15 300

9 5 40 20 800

10 5 12 10 120 5 5

13
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021
Answers to Student’s Book

b • input length and breadth of 10 parcels

• check length and breadth less than 30 for each parcel

• calculate size and check size less than 600 for each parcel

• increment the number of parcels accepted or the number of parcels rejected •


output number of parcels accepted and number of parcels rejected
c Length and breadth must be less than or equal to 30. Size must be less than or equal to 600. 7 a •

Error 1: Counter ← 1 should be Total ← 0

• Error 2: UNTIL Number < 0 should be UNTIL Number > 0

• Error 3: Total ← Total + Counter should be Total ← Total +


Number

• Error 4: Counter ← Counter + 1 is not required

• Error 5: OUTPUT Total should be after the end of the loop

• Error 6: NEXT Number should be NEXT Counter

b Total ← 0

FOR Counter ← 1 TO 10

REPEAT
OUTPUT "Enter a positive whole number "
INPUT Number
UNTIL Number > 0

Total ← Total + Number

NEXT Counter
OUTPUT Total
c Test data: 1, 0, 67, 10, 22, −10, 3, 7, 2, 8, 1, 9 (sample – yours might be
different).
Counter Number Total OUTPUT

1 1 1

2 0

67 68

3 10 78

4 22 100

5 -10

3 103

6 7 110

7 2 112

8 8 120

9 1 121

10 9 130 130

14
Cambridge IGCSE and O Level Computer Science Teacher's Guide
© David Watson and Helen Williams 2021

You might also like