You are on page 1of 254

Please check the examination details below before entering your candidate information

Candidate surname Other names

Centre Number Candidate Number


Pearson Edexcel
International GCSE (9–1)

Monday 20 May 2019


Afternoon (Time: 2 hours) Paper Reference 4CP0/01

Computer Science
Paper 1: Principles of Computer Science

You must have: Total Marks


Pseudocode command set (enclosed)

Instructions
• Use black ink or ball-point pen.
• centrethe
Fill in boxes at the top of this page with your name,
number and candidate number.
• Answer all questions.
• Answer the questions in the spaces provided
– there may be more space than you need.

Information
• The total mark for this paper is 80.
• The marks for each question are shown in brackets
– use this as a guide as to how much time to spend on each question.
• You are not allowed to use a calculator.
Advice
• Read each question carefully before you start to answer it.
• Try to answer every question.
• Check your answers if you have time at the end.
• giving further
Marks will not be awarded for using product or trade names in answers without
explanation.

Turn over

*P61880A0124*
P61880A
©2019 Pearson Education Ltd.

1/1/1/1/1/1
Answer ALL questions. Write your answers in the spaces provided.
Some questions must be answered with a cross in a box . If you change your mind about an
answer, put a line through the box and then mark your new answer with a cross .
1 Computers are made up of both hardware and software components.
(a) Computers use a three-step computational model.
Complete the diagram with the names of the three steps.
(3)

(b) Identify the hardware component responsible for controlling the


fetch-decode-execute cycle.
(1)

A Cache
B Central processing unit

C ROM

D Address bus
(c) Von Neumann developed the stored program concept that permits two different
types of item to reside in memory.
Name these two types.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .......................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .......................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2
*P61880A0224*
(d) Some computers use virtual memory.
Explain how virtual memory works.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(e) An optical storage device writes data onto a CD or DVD.


Describe how data is stored physically on optical media.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(f ) A disc-formatting program is an example of a type of software.


Identify the type.
(1)

A Security software

B Application software

C Translation software

D System software

(Total for Question 1 = 11 marks)

*P61880A0324*
3
Turn over
2 Zafer and Robert work for a company that makes washing machines.
(a) Zafer writes user manuals for the washing machines.
He stores these documents in the cloud.
Zafer and the cloud storage provider share responsibility for data security.
State one area of responsibility for each of them.
(2)
Zafer

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Cloud storage provider

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) Robert programs the robots that make the parts for the washing machines.
Zafer writes the user manuals.
Robert and Zafer have different levels of access to folders and files on the
company network.
The different levels of access are Read, Write, Execute and None.
Complete the table to show the levels of access that each has.
(2)

Robert Zafer

Washing machine design


drawings
A folder of manuals for new
machines

4
*P61880A0424*
(c) Zafer uses a browser to view pages on Pearson’s website by typing a uniform
resource locator into a browser. This is shown in Figure 1.

www.pearson.com

Figure 1

Pearson’s machine Zafer’s machine

MAC address: 03-57-00-EC-4B-30 MAC address: 00-15-00-BC-9A-90


IPv4 address: 2.20.38.113 IPv4 address: 192.168.1.78
IPv4 Subnet Mask: 255.255.0.0 IPv4 Subnet Mask: 255.255.255.0
Website domain: www.pearson.com Web browser
Main web page: https://www.pearson.com/uk/ Uniform resource locator: www.pearson.com

A domain name server is used in this process.


Identify the input to and the output from the domain name server.
(2)
Input

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Output

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*P61880A0524*
5
Turn over
(d) Zafer can use a desktop or a tablet computer to connect to the internet.
Only the tablet has wireless capabilities.
The diagram shows the components used to connect to the internet.
Complete the diagram to show how the desktop and the tablet are connected to
the internet.
(6)

Modem

Desktop

Internet
Switch Service
Provider

Tablet
Router

Rest of
internet

Wireless
Access Point
(WAP)

(Total for Question 2 = 12 marks)

6
*P61880A0624*
3 Isra works in an office building where she has access to different types of network.
(a) Isra uses different types of networks for different tasks.
(i) Name the type of network she uses to print a document on the printer in the
office next door.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Name the type of network she uses to order stationery from an online
supplier.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) Identify the measurement used for network data speeds.


(1)

A Megabits per second

B Megapixels per second

C Mebicycles per second

D Mebihertz per second

*P61880A0724*
7
Turn over
(c) Isra uses her tablet computer and smartphone to access email.
She wants to set up a new email account.
State the email protocol she should use.
Justify your choice.
(3)
Email protocol

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Justification

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(d) The table describes characteristics of different network topologies.


Complete the table to match each characteristic to one network topology.
(4)

Characteristic Bus Ring Star Mesh

Network performance degrades as


more devices are added.
All devices are directly connected to
all others.
Each node has a physical attachment
to a routing device.
There are no data collisions, because
packets travel in the same direction.

8
*P61880A0824*
(e) Information sent across networks is represented in bit patterns.
(i) The bit pattern 1101 0001 uses sign and magnitude representation.
Convert this bit pattern to a denary number.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Convert the denary number 75 to 8-bit binary.


(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*P61880A0924*
9
Turn over
(iii) The addition of these two 8-bit binary patterns generates an error condition.

0 1 1 0 1 1 0 1

1 1 0 0 0 0 0 0 +

0 0 1 0 1 1 0 1

Explain this error condition.


(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 3 = 16 marks)

10
*P61880A01024*
4 One function of an operating system is file management.
(a) Both kibibyte and kilobyte can be used as measures of file size.
Compare kibibyte and kilobyte.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) An image is 2322 pixels high and 4128 pixels wide.


The image is stored with a 16-bit colour depth.
The metadata for the image is 975 bytes.
Construct an expression to show how the file size, in megabytes, is calculated.
You do not need to do the calculation.
(4)

*P61880A01124*
11
Turn over
(c) Operating systems often include compression software for reducing file sizes.
(i) Give two reasons for reducing file sizes.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Give two drawbacks of using compression software.


(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12
*P61880A01224*
(d) A text file is stored on a hard disc.
The file holds information from one side of a sheet of paper.
The sheet of paper is represented as a grid, 80 columns wide and 66 rows long.
Each cell in the grid contains a single 2-byte Unicode character.
The file also contains 40 characters of metadata.
The hard disc allocates space in blocks of 1024 bytes.
Construct an expression to show the number of blocks required to store the file.
You do not need to do the calculation.
(4)

(Total for Question 4 = 14 marks)

*P61880A01324*
13
Turn over
5 Ships carry cargo around the world in containers.
(a) Containers come in two sizes.
Figure 2 shows an algorithm written using flowchart symbols.

Start

volume1 = 24.00 reqVolume Yes


<= volume1

volume2 = 48.00

No
print “Requires
minVolume = volume1 / 2 small container”

input width
reqVolume No
<= volume2
input height

Yes
input length
print “Requires
large container”
reqVolume = width * length * height

print “Too large for


cargo container”

reqVolume < No
minVolume

Yes

print “Too small for


cargo container”

Stop

Figure 2

14
*P61880A01424*
(i) Complete the table to show the output for each cargo item.
(3)

Cargo item
Output
width length height

4 4 2

2 2 2

3 8 5

(ii) State the purpose of the algorithm in Figure 2.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*P61880A01524*
15
Turn over
(b) Each ship is registered to a state.
Figure 3 shows a partially completed algorithm written in pseudocode.
The completed algorithm must:
• print each state to the display on a new line
• count the number of states
• create a message as a single string (e.g. there are number states)
• print the message to the display.
Complete the algorithm in the space provided in Figure 3.
(4)

SET numStates TO 0
SET states TO [“France”, “Singapore”, “Malta”, “Panama”, “Greece”, “Italy”]

FOR EACH state FROM states DO

END FOREACH

Figure 3

16
*P61880A01624*
BLANK PAGE

*P61880A01724*
17
Turn over
(c) Cargo ships have maximum weight loads.
Figure 4 shows an algorithm written using pseudocode.
The algorithm should identify the size of cargo ship required for any load.
There is an error on line 9.

2 SET loadWeight TO [20000, 28000, 40000, 50000]


3 SET index TO 0
4 SET found TO FALSE
5
6 SEND “Enter cargo weight” TO DISPLAY
7 RECEIVE target FROM (INTEGER) KEYBOARD
8
9 WHILE (NOT found) DO
10 IF (loadWeight [index] >= target) THEN
11 SEND loadWeight [index] TO DISPLAY
12 SET found TO TRUE
13 ELSE
14 SET index TO index + 1
15 END IF
16 END WHILE
17
18 IF (NOT found) THEN
19 SEND “No ship available” TO DISPLAY
20 END IF

Figure 4

18
*P61880A01824*
(i) Trace tables are used to identify errors in algorithms.
Complete the trace table for an input of 50500 to show what happens due to
the error on line 9 in the pseudocode in Figure 4.
You may not need to fill in all the rows in the table.
(2)

target found index loadWeight[index]

50500 FALSE 0

(ii) Construct a single line of pseudocode to correct line 9.


(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 5 = 12 marks)

*P61880A01924*
19
Turn over
6 A train company uses ticket vending machines at each station.
(a) The machines use embedded systems.
(i) Explain one benefit of using an embedded system in these machines.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Customers use a touch screen to select their destination. They can pay by cash
or bank card. Their tickets and a receipt are printed.
The touch screen is controlled by an embedded system.
Give two other hardware components in the ticket machine that are
controlled by embedded systems.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) The ticket machine uses data encryption when a customer pays using a bank
card.
State why data encryption is used in this case.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20
*P61880A02024*
(b) Compare four features of high-level and low-level programming languages.
(4)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*P61880A02124*
21
Turn over
(c) Artificial intelligence (AI), in many forms, has an increasing impact on our lives.
Discuss this statement considering characteristics, uses and ethical issues.
(6)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 6 = 15 marks)

TOTAL FOR PAPER = 80 MARKS

22
*P61880A02224*
BLANK PAGE

*P61880A02324*
23
BLANK PAGE

24
*P61880A02424*
Mark Scheme (Results)

Summer 2019

Pearson Edexcel International GCSE


In Computer Science (4CP0)
Paper 01 Principles of Computer Science
Edexcel and BTEC Qualifications

Edexcel and BTEC qualifications are awarded by Pearson, the UK’s largest awarding body. We
provide a wide range of qualifications including academic, vocational, occupational and specific
programmes for employers. For further information visit our qualifications websites at
www.edexcel.com or www.btec.co.uk. Alternatively, you can get in touch with us using the
details on our contact us page at www.edexcel.com/contactus.

Pearson: helping people progress, everywhere

Pearson aspires to be the world’s leading learning company. Our aim is to help everyone
progress in their lives through education. We believe in every kind of learning, for all kinds of
people, wherever they are in the world. We’ve been involved in education for over 150 years,
and by working across 70 countries, in 100 languages, we have built an international reputation
for our commitment to high standards and raising achievement through innovation in
education. Find out more about how we can help you and your students at:
www.pearson.com/uk

Summer 2019
Publications Code 4CP0_01_1906_MS
All the material in this publication is copyright
© Pearson Education Ltd 2019
General Marking Guidance

• All candidates must receive the same treatment. Examiners must mark the first
candidate in exactly the same way as they mark the last.
• Mark schemes should be applied positively. Candidates must be rewarded for what
they have shown they can do rather than penalised for omissions.
• Examiners should mark according to the mark scheme not according to their
perception of where the grade boundaries may lie.
• There is no ceiling on achievement. All marks on the mark scheme should be used
appropriately.
• All the marks on the mark scheme are designed to be awarded. Examiners should
always award full marks if deserved, i.e. if the answer matches the mark
scheme. Examiners should also be prepared to award zero marks if the candidate’s
response is not worthy of credit according to the mark scheme.
• Where some judgement is required, mark schemes will provide the principles by
which marks will be awarded and exemplification may be limited.
• When examiners are in doubt regarding the application of the mark scheme to a
candidate’s response, the team leader must be consulted.
• Crossed out work should be marked UNLESS the candidate has replaced it with an
alternative response.
Question Answer Additional Guidance Mark
Number
1(a) Award one from:
Input, process, output in this order – 3 marks
Input, process, output in any order – 2 marks
At least one of input, process, output – 1 mark
3

Question Answer Additional Guidance Mark


Number
1(b) B: Central processing unit

The only correct answer is B

A is not correct as this is memory only

C is not correct as this is memory only

D is not correct as this is used only for


transporting memory addresses
1

Question Answer Additional Mark


Number Guidance
1(c) • Data (1)
• Instructions (1) 2

Question Answer Additional Mark


Number Guidance
1(d) Any two from:

1. Virtual memory (VM) is used when RAM


becomes full (1) (to hold all programs and
data).
2. Virtual memory is used as (an extension
to) main memory/RAM / works like RAM.
(1)
3. Virtual memory is stored/created on
(internal) secondary storage/HDD/SSD. (1)
4. Virtual memory is used as temporary
storage. (1)
5. Instructions and data not currently being
used are transferred from RAM to
VM/HDD. (1)
6. When needed again, instructions and
data are transferred back to RAM. (1) 2
Question Answer Additional Mark
Number Guidance
1(e) Any two from:

1. The disc surface is made out of


polycarbonate. (1)
2. A laser (beam) is used. (1)
3. Data is stored as a series of tiny grooves
arranged in tracks on the surface of the
disc. (1)
4. Bumps/lands/flats/troughs/pits/dips
imprinted/burnt on the disc. (1)
5. Bumps and flats (etc.) represent 1 and 0
(bits) / the reflection (of the laser)
represents 1 and 0 (bits). (1) 2

Question Answer Additional Mark


Number Guidance
1(f) D: System software

The only correct answer is D

A is not correct because this category is purely


for software that is used for security purposes

B is not correct because this category is


designed for end user tasks rather than for
managing the computer itself

C is not correct because this software is used to


translate a high level program into machine code
1
Question Answer Additional Mark
Number Guidance
2(a) Award one from each:

Zafer:
1. Choose strong (1) authentication credentials
(username/password)
2. Not sharing his credentials (1)
3. Not having automatic login to cloud /
leaving his machine unattended (1)
4. Changing password regularly (1)
5. Password protect documents (1)

Provider:
1. Infrastructure (e.g. firewall/servers) must be
secure from unauthorised access (1)
2. Keeping their security software up to date
(1)
3. Policy and procedures effective in
preventing an insider attack / a data breach
(1)
4. Data protection laws in the resident country
must be obeyed (1)
5. Backup and restore procedures (1)
6. Encryption (1) 2

Question Answer Additional Mark


Number Guidance
2(b) Two marks if completely correct. Ignore
One mark for any two correct cells. spelling
mistakes

Robert Zafer
Washing machine
Read Read
design drawings
Read, Write
A folder of manuals
None Or
for new machines
Write, Read

2
Question Answer Additional Mark
Number Guidance
2(c) Award one mark from each category (maximum of 2) Don’t
penalise
Input: spelling or
• www.pearson.com / website domain (1) typos,
• Uniform Resource Locator / URL (of Pearson especially
website) (1) in
addresses
Output:
• 2.20.38.113 (1)
• Pearson’s machine IP(v4) address (1)

Question Answer Additional Mark


Number Guidance
2(d) One mark for each dotted connection, correctly located.
Maximum of 6 marks.

Note: WAP can be connected to either the Switch or the


Router, but not both

6
Question Answer Additional Mark
Number Guidance
3(a)(i) • LAN / Local area network (1)

Allow PAN/Personal Area Network 1

Question Answer Additional Mark


Number Guidance
3(a)(ii) • WAN / Wide area network (1) 1

Question Answer Additional Mark


Number Guidance
3(b) A: Megabits per second

The only correct answer is A

B is not correct because megapixels are


associated with images rather than network data
speeds

C is not correct because mebicycles are not


associated with network data speeds

D is not correct because mebihertz are not


associated with network data speeds
1
Question Answer Additional Mark
Number Guidance
3(c) • IMAP (1)

AND one from:


• because changes are synced (1) with the
mail server in real-time (1)
• because the messages always reside on
the email server (1) as she has limited
storage (1) on her tablet and phone
• it gets sent to both smartphone and
tablet (1)

Alternative answer:
• POP3 (not awarded a mark)

AND one from:


• because storage limitations on server (1)
and privacy issues (1)
• because more CPU time (1) may be used
when syncing (1) (a large number of
messages). 3

Question Answer Additional Mark


Number Guidance
3(d)

Characteristic Bus Ring Star Mesh

Network performance
degrades as more devices 
are added.
All devices are directly or
indirectly connected to all 
others.
Each node has a physical
attachment to a routing 
device.
There are no data
collisions, because

packets travel in the same
direction.
4
Question Answer Additional Mark
Number Guidance
3(e)(i) -81

One mark for negative sign


One mark for 81. 2

Question Answer Additional Mark


Number Guidance
3(e)(ii) One mark for each nibble in correct order

0100 1011 2
Question Answer Additional Mark
Number Guidance
3(e)(iii) Any two from:

1. This is an overflow (1) error


2. It is caused by adding two 1s in the most
significant bit (1)
3. The resulting number is too large to fit in
the number of bits available / requires 9
bits / the number is larger than 28 / there
is 1 that needs to be carried over (in MSB)
/ MSB gets discarded (1)
4. It can cause the program to crash or
produce unreliable/incorrect results (1) 2

Question Answer Additional Mark


Number Guidance
4(a) Any two from: Ignore units

Kilobyte is a SI (physics/science) / International


System of Units measurement, whereas Kibibyte
is an IEC (computing) / International
Electrotechnical Commission / International
System of Quantities / ISO measurement (1)

Kilobyte is equivalent to 1000 bytes, whereas a


kibibyte is equivalent to 1024 bytes (1)

Kilobyte is equivalent to 103 bytes, whereas a


kibibyte is equivalent to 210 bytes (1)

Kilobyte is a base 10 measurement, whereas a


kibibyte is a base 2 measurement (1) 2
Question Answer Additional Mark
Number Guidance
4(b) Award 4 marks for 19.17 • Arithmetic
precedence
or rules must be
clearly followed
One mark for each of: • Units are not
required
• Equivalent
• Calculates correct bits/bytes(1) expressions are
• Adds metadata (1) accepted
• Calculates correct megabytes (1) • Calculations not
• Completely correct response (1) explicit
(8x1000x1000)
Examples: but expressed
(8000000) gain
2322 × 4128 × 16 the mark
+ 975
8
1000 × 1000

(2322 × 4128 × 2 ) + 975


1000 × 1000

((2322 x 4128 x 16 bits per colour) ÷ 8 bits per byte) + 975 bytes
--------------------------------------------------------------------------------------
1000 bytes per KB x 1000 kilobytes per MB

((2322 x 4128 x 2 bytes per colour) + 975 bytes


--------------------------------------------------------------------------------------
1000 bytes per KB x 1000 kilobytes per MB
4
Question Answer Additional Mark
Number Guidance
4(c)(i) Any two from:

• To save disc/storage space (1)


• Reduce transmission time (1)
• Meet email attachment size restrictions (1)
2

Question Answer Additional Mark


Number Guidance
4(c)(ii) Any two from:

• Compressing / decompressing the file


takes execution time (1)
• Both compressing and decompressing
have to be done with compatible
software / both ends of transmission
have to use compatible software (1)
• (If the compression utility uses a lossy
algorithm then) some of the data will be
permanently removed / it won't be
possible to reconstruct the original file.
(1)
• Can affect the quality of the file (1)
• File size can increase (1) 2
Question Answer Additional Guidance Mark
Number
4(d) Award 4 marks for 11 • Arithmetic
Award 3 marks for a value between 10 and 11 precedence rules
must be clearly
One mark for each: followed
• Units are not
• 80 x 66 x 2 or 80 x 66 x 16 ÷ 8 (1) required
• + 40 or + 80 (1) • Alternative
• ÷ 1024 (1) notations for ceiling
• Ceiling or RoundUp (1) are accepted
• If 16 bits per
Unicode character
is not awarded,
then allow follow
through error
• Allow follow
through error, if
interim calculations
attempted
• Equivalent
expressions are
accepted 4
Question Answer Mark
Number
5(a)(i)
One mark for each correct row

Width Length Height Output

4 4 2 Requires large container (1)

2 2 2 Too small for cargo container (1)

3 8 5 Too large for cargo container (1)

Do not penalise spelling


3

Question Answer Additional Mark


Number Guidance
5(a)(ii) Any response that indicates the concept of:

Determining which size shipping container is


needed for the indicated cargo. 1
Question Answer Additional Guidance Mark
Number
5(b) SEND states [numStates] TO DISPLAY (1) • Accept , or + in
or place of &
SEND state TO DISPLAY (1) • Ignore
capitalisation of
SET numStates TO numStates + 1 (1) commands
or •
LENGTH(states) (1)

Concatenation of message and variable uses “


and &

& numStates & TO DISPLAY (1)


or
& LENGTH(states) & TO DISPLAY (1)
or
STRING(numStates) TO DISPLAY (1)

Pseudocode is correct (1)


4
Question Answer Additional Guidance Mark
Number
5(c)(i) • There does not
Showing that index goes up to 4 and does not have to be an
exceed 4 (1) explicit
indication of the
Showing correspondence between values of out-of-bounds /
index and loadWeight[index] (1) crashing error.
• Ignore target and
found columns
• Allow two rows
per loop with
matching index
and loadWeight
values 2

target found index loadWeight[index]


50500 FALSE 0 20000
1 28000
2 40000
3 50000
4

target found index loadWeight[index]


50500 FALSE 0
1 20000
2 28000
3 40000
4 50000

Question Answer Additional Guidance Mark


Number
5(c)(ii) 1. Use of AND operator (in the test of relevant • Do not penalise
conditions) (1) pseudocode
2. Use of suitable function to find the length of syntax
the array using a correct comparison to index • Ignore changes
(1) to first condition
as long as
meaning is not
Example: lost

WHILE ((NOT found) AND (index < LENGTH


(loadWeight))) DO

2
Question Answer Additional Mark
Number Guidance
6(a)(i) Features such as power consumption /
processor / memory / number and type of
components / physical size (1) can be optimised
/ chosen to fit just one specific task. (1) 2

Question Answer Additional Mark


Number Guidance
6(a)(ii) Any two from: Allow any
hardware that
• Printer (1) relates to paying
• Bank card (magnetic strip) by cash for MP4
reader/scanner (1)
• Bank card contactless/NFC
reader/scanner (1)
• Cash input and giving change device (1) 2

Question Answer Additional Mark


Number Guidance
6(a)(iii) To prevent unauthorised people from reading / Do not award ‘to
understanding the bank card information (1) keep it from
being hacked /
accessed’. 1
Question Answer Additional Mark
Number Guidance
6(b) Award one mark for each of (maximum of 4): For each mark
point:
1. Readability: high-level language is easily • the general
readable by a human because it is feature is
designed to look like English whereas a followed by
low-level language is binary patterns / exemplification
mnemonics / abbreviations. (1) • needs to be a
2. Portability: code written in a high-level comparison,
language is easily transportable across which may be
machines whereas a low-level language is implicit
designed for a specific microprocessor /
piece of hardware. (1)
3. Uses: low-level languages are commonly
used to write programs for hardware or
devices, like printers, whereas high-level
languages are commonly used for to
write higher-level applications, such as
word processors. (1)
4. Optimisation: low-level languages are
used to improve performance, especially
of hardware, whereas high-level
languages have to go through multiple
layers of software to get to the hardware,
e.g. the need for HLL to be
compiled/interpreted makes
programmes run slower than LLL, HLL
has a higher level of abstraction
removing unnecessary detail (one to
many), LLL keeps more of a detail (one to
one) (1)
5. Ease of use: high-level languages usually
have tools, functions, libraries and
development environments which are
accessible, even by those with little
knowledge, whereas, low-level languages
are often challenging to work with and
require expertise and depth of
knowledge. (1) 4
Question Answer Mark
Number
6(c) Indicative content:

Characteristics – Any of the following:

• Implemented in software.
• Could involve the use of neural networks /
clustering / modelling
• Algorithms are trained by exposure to data that
has been validated / checked
• Algorithms learn by identifying commonalities
between the validated / checked data
• Algorithms make predictions for new data based
on prior learning
• Algorithms may incorporate recursive self-improvement

Uses – Any of the following:

• Game playing (opponents)


• Analytics (analyse buying patterns, predicting behaviours,
predictive text, targeted advertising, personalised news
feeds, friend suggestions)
• Image / Audio processing (recognising objects/patterns, face
recognition)
• Logistics (scheduling, order fulfilment)
• Control systems (cars, manufacturing, weapons, navigation
• Diagnostic systems (medical, mechanical, electrical)
• Natural languages processing (chatterbots, chatbots, speech
recognition, personal assistants)
• Robotics (dangerous situations, help aged or disabled)

Ethical issues – Any of the following:

• Training sets could include data that should not be used to


make decisions (race, religion, gender, etc.) that could cause
biased outcomes
• Is a computer to be trusted to make decisions (life-death)?
• If a computer discovers something that humans can’t prove,
should it be accepted as truth?
• How do we know that the answer produced is correct?
• Will people be comfortable interacting with machines that
are considered intelligent?
• Some jobs may be at risk, especially those requiring human
skills such as empathy or creativity. 6
Level Mark Descriptor

0 No rewardable content.
Level 1 1–2 Basic, independent points are made showing elements of
knowledge and understanding of key concepts/principles of
computer science.

The discussion will contain basic information with little linkage


between points made.
Level 2 3-4 Demonstrates adequate knowledge and understanding of key
concepts/principles of computer science.

The discussion shows some linkages and lines of reasoning with


some structure.
Level 3 5-6 Demonstrates comprehensive knowledge and understanding by
selecting relevant knowledge and understanding of key
concepts/principles of computer science to support the discussion
being presented.

The discussion shows a well-developed, sustained line of reasoning


which is clear, coherent and logically structured.
Pearson Education Limited. Registered company number 872828
with its registered office at 80 Strand, London, WC2R 0RL, United Kingdom
Please check the examination details below before entering your candidate information
Candidate surname Other names

Centre Number Candidate Number


Pearson Edexcel
International GCSE (9–1)

5–7 June 2019


Time: 3 hours Paper Reference 4CP0/02

Computer Science
Paper 2: Application of Computational Thinking

You must have: A computer workstation with an appropriate programming Total Marks
language code editing software and tools, including a code interpreter/compiler,
CODES folder containing code and data files, pseudocode command set (enclosed)

Instructions
• Use black ink or ball-point pen.
• centrethe
Fill in boxes at the top of this page with your name,
number and candidate number.
• Answer all questions.
• Answer the questions requiring a written answer in the spaces provided
– there may be more space than you need.
• Only one programming language (Python, C# and Java) must be used
throughout the test.
• Carry out practical tasks on the computer system and save new or amended code
using the name given in the question with the appropriate file extension.
• Do not overwrite the original code and data files provided to you.
• You must not use the internet during the test.
Information
• The total mark for this paper is 80.
• The marks for each question are shown in brackets
– use this as a guide as to how much time to spend on each question.
• This paper covers Python, C# and Java.
• The invigilatorfolder
The CODES in your user area includes all the code and data files you need.
• will tell you where to store your work.
Advice
• Read each question carefully before you start to answer it.
• Save your work regularly.
• your answers if you have time at the end.
Check
Turn over

*P61881RA0116*
P61881RA
©2019 Pearson Education Ltd.

1/1/1/1/1
Answer all questions.
Answer the questions requiring a written answer in the spaces provided.
Some questions must be answered with a cross in a box . If you change your mind about an
answer, put a line through the box and then mark your new answer with a cross .
Carry out practical tasks on the computer system and save new or amended code using the name
given with the appropriate file extension.
Use only ONE programming language throughout the examination.
Indicate the programming language that you are using with a cross in a box .

C# Java Python

1 Computer programs use several different programming constructs.


(a) Identify the most appropriate data type for the value 4.5
(1)
A Boolean

B Character

C Real

D String
(b) Give a definition of a logic error.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) Open Q01c in the code editor.


The program should print out a counter and the counter with 7 added to it.
There are three errors in the code.
Amend the code to correct the errors.
Save your amended code as Q01cFINISHED with the correct file extension for the
programming language.
(3)
(d) Give one reason why computer programmers should use comments in their
programs.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2
*P61881RA0216*
(e) Describe the difference between a local variable and a global variable in
a computer program.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(f ) Trevor is the manager of a shoe shop.


Sales assistants can earn a bonus based on the numbers of pairs of shoes they sell
and the total income for the shop each day.
Open Q01f in the code editor.
Amend the code to complete the ‘if statement’ used to produce the outputs
described in the table.

Condition Output

Shop income is more than £5000 or


sales assistant has sold at least Bonus is 10% of salary
10 pairs of shoes
Shop income is £2000 or more and
sales assistant has sold at least Bonus is 5% of salary
5 pairs of shoes

Do not add any further functionality.


Save your amended code as Q01fFINISHED with the correct file extension for the
programming language.
(4)

*P61881RA0316*
3
Turn over
(g) Car registration codes consist of seven characters.
The characters are two upper case letters followed by two numbers and then
three upper case letters.
YH62KLV, EY09VPB and CK53PRJ are valid codes.
All codes need to be validated.
Complete the table to show two additional validation tests.
For each test give one example of erroneous data. The example that you give
should fail only that test.
(4)

Validation test Erroneous data

Is it 7 characters? AB12CD

(Total for Question 1 = 16 marks)

4
*P61881RA0416*
2 Anna has a 5-year-old daughter, Beatrice, and a 14-year-old son, Graham.
(a) Anna wants to program a guessing game for Beatrice to play on the computer.
The program will generate a random number between 1 and 10.
Beatrice has to guess the number.
This pseudocode contains the logic required to create the game.

1 # Initialise variables
2 SET counter TO 1
3 SET answer TO RANDOM(9) + 1 # i.e. a random integer 1 to 10 inclusive
4 SET guess TO 0
5
6 # Print prompt and take guess from user
7 SEND “Enter a number from 1 to 10: ” TO DISPLAY
8 RECEIVE guess FROM (INTEGER) KEYBOARD
9
10 # Create while loop to check guess
11 WHILE guess <> answer DO
12 SET counter TO counter + 1
13 IF guess > answer THEN
14 SEND (guess & “ was too high. Try again.”) TO DISPLAY
15 ELSE
16 SEND (guess & “ was too low. Try again.”) TO DISPLAY
17 END IF
18 SEND “Guess again: ” TO DISPLAY
19 RECEIVE guess FROM (INTEGER) KEYBOARD
20 END WHILE
21
22 # Report the correct answer to the user and display the number of guesses
23 SEND (“You guessed “ & guess & “ in “ & counter & “guesses.”) TO DISPLAY

Write a program to implement the logic in the pseudocode.


Open Q02a in the code editor.
You must use the structure give in Q02a to write the program.
Do not add any further functionality.
Save your code as Q02aFINISHED with the correct file extension for the
programming language.
(10)

*P61881RA0516*
5
Turn over
(b) Anna has written a program to help Graham with calculations for his science
lessons.
Open Q02b in the code editor.
Use the code to answer these questions.
(i) State the value of distance when the program finishes.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Give one reason why there are brackets around newSpeed + initialSpeed
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) State the data type for the variable distance.


Justify your answer.
(2)
Data type

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Justification

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iv) State the value of distance when acceleration is 2.75


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6
*P61881RA0616*
(c) Anna has written a program that manipulates text.
Open Q02c in the code editor.
Use the code to answer these questions.
(i) Identify a line number where the code includes a relational operator.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Identify a line number where a variable is set to a numeric value entered by
a user.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) Identify the name of a variable passed from the main program to the
subprogram.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iv) Identify the name of a variable that receives the value calculated by the
subprogram.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(v) State the value returned by the subprogram when the input values are
educational, 3, 6
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*P61881RA0716*
7
Turn over
(vi) State the purpose of the subprogram.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 2 = 23 marks)

8
*P61881RA0816*
3 Different algorithms can be used to manipulate data.
(a) Email.txt contains a list of email addresses.
Open Q03a in the code editor.
Write a program to implement these requirements.
The code must:
• check each email address to ensure it contains the ‘@’ symbol.
• write email addresses that do not contain the ‘@’ symbol to an Error.txt file.
You must use the structure given in the file Q03a to complete the program.
Do not add further functionality.
Save your code as Q03aFINISHED with the correct file extension for the
programming language.
(6)
(b) Explain one drawback of using the merge sort algorithm to sort large data sets.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) Open Q03c in the code editor.


Write a program to display the square and cube of a number between 1 and 50
entered by a user.
The code must:
• ask the user to enter a number between 1 and 50 inclusive
• display the number, the square of the number and the cube of the number,
with appropriate labels
• stop when a number outside the range 1 to 50 is entered.
Save your code as Q03cFINISHED with the correct file extension for the
programming language.
(6)

(Total for Question 3 = 14 marks)

*P61881RA0916*
9
Turn over
4 Encryption is used to encode data.
(a) Identify the word that describes a Pigpen cipher.
(1)
A Plaintext

B Random

C Shift

D Substitution
(b) Figure 1 shows a Pigpen cipher grid.
(3)

Figure 1
Complete the table to decode the symbols using the grid in Figure 1.

Symbol Letter

10
*P61881RA01016*
(c) Figure 2 shows another grid.

Figure 2
State whether this set of symbols meets the requirements of a Pigpen cipher.
Justify your answer.
(3)
State

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Justification

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 4 = 7 marks)

*P61881RA01116*
11
Turn over
5 Ria is a school librarian.
She wants a program to analyse pupil use of the library.
She wants to encourage reading by awarding gold, silver and bronze medals to the
three pupils who have read the most books.
Test data has been included in the code.
Open Q05 in the code editor.
Write a program to calculate and display:
• the total number and average number of books pupils have read
• the IDs of pupils who have read fewer than ten books
• the details of the gold, silver and bronze medal winners.
Your program should function correctly even if the number of pupils in the file
is changed.
Save your code as Q05FINISHED with the correct file extension for the programming
language.
(20)

12
*P61881RA01216*
You may use this space for planning / design work.

(Total for Question 5 = 20 marks)

TOTAL FOR PAPER = 80 MARKS

*P61881RA01316*
13
BLANK PAGE

14
*P61881RA01416*
FOR EXAMINER USE

1
2
3
4 1
5 2
2a
6 3
7 4

Points marked
1a 1 8 5
1b 1 9 6
1 10 1 7
1c 2 2bi 1 2 8
3 2bii 1 3 9
3a
1d 1 1 4 10
2biii 5
1 2 5 11
1e
2 2biv 1 6 1
1 2ci 1 1 2
3b
2 2cii 1 2 4a 1 3

Levels marked
1f
3 2ciii 1 1 1 4
4 2civ 1 2 4b 2 5
1 1 3 3 6
2cv 3c
2 2 4 1 7
1g
3 1 5 4c 2 8
2cvi
4 2 6 3 9

Q1 16 Q2 23 Q3 14 Q4 7 Q5 20

*P61881RA01516*
15
BLANK PAGE

16
*P61881RA01616*
Mark Scheme (Results)

Summer 2019

Pearson Edexcel International GCSE


In Computer Science (4CP0)
Paper 02: Application of Computational Thinking
Edexcel and BTEC Qualifications

Edexcel and BTEC qualifications are awarded by Pearson, the UK’s largest awarding body. We
provide a wide range of qualifications including academic, vocational, occupational and specific
programmes for employers. For further information visit our qualifications websites at
www.edexcel.com or www.btec.co.uk. Alternatively, you can get in touch with us using the details
on our contact us page at www.edexcel.com/contactus.

Pearson: helping people progress, everywhere

Pearson aspires to be the world’s leading learning company. Our aim is to help everyone progress
in their lives through education. We believe in every kind of learning, for all kinds of people,
wherever they are in the world. We’ve been involved in education for over 150 years, and by
working across 70 countries, in 100 languages, we have built an international reputation for our
commitment to high standards and raising achievement through innovation in education. Find out
more about how we can help you and your students at: www.pearson.com/uk

Summer 2019
Publications Code 4CP0_02_1906_MS
All the material in this publication is copyright
© Pearson Education Ltd 2019
General Marking Guidance

• All candidates must receive the same treatment. Examiners must mark the first
candidate in exactly the same way as they mark the last.
• Mark schemes should be applied positively. Candidates must be rewarded for what
they have shown they can do rather than penalised for omissions.
• Examiners should mark according to the mark scheme not according to their
perception of where the grade boundaries may lie.
• There is no ceiling on achievement. All marks on the mark scheme should be used
appropriately.
• All the marks on the mark scheme are designed to be awarded. Examiners should
always award full marks if deserved, i.e. if the answer matches the mark
scheme. Examiners should also be prepared to award zero marks if the candidate’s
response is not worthy of credit according to the mark scheme.
• Where some judgement is required, mark schemes will provide the principles by which
marks will be awarded and exemplification may be limited.
• When examiners are in doubt regarding the application of the mark scheme to a
candidate’s response, the team leader must be consulted.
• Crossed out work should be marked UNLESS the candidate has replaced it with an
alternative response.
This mark scheme is presented so that questions requiring a handwritten response are grouped at the start.
This is followed by the mark scheme for the questions which require submission of coding.
Examples of coding that would gain marks is grouped at the end in order of coding language.

Question Answer Additional Guidance Mark


1(a) The only correct answer is C

A is not correct because Boolean only has values True and


False
B is not correct because it only allows for one character
D is not correct because it is used for mixed text and numeric
data
(1)
1(b) (an error that) produces incorrect /unintended output (1) Accept an example of an explained logic error (1)
1(d) Any one from:
1. explain how the program works (1)
2. improve readability of the program (1)
3. make code more understandable (1) (1)
1(e) 1. Global variables created in the main program / can be
accessed from any part of the program / are in scope
throughout the program (1)
2. Local variables are declared/created inside a
function/blocked code (indented, brackets) and are only
accessible there / are only in scope within the function in
which they’re declared (1) (2)
Question Answer Additional Guidance Mark
1(g) For up to two tests Each test should target a different feature of one of the
Award 1 mark for an appropriate validation test and 1 mark requirements
for an item of test data that would fail only the given test • Exactly 7 characters (in the stem)
• First two characters are letters / upper case
Validation test Erroneous data letters
Are the first two 1234CCC • Characters 3 & 4 are numeric
characters letters/upper • Last three characters are letters / upper case
case letters? letters
Are the third- and fourth- CCCCBBB
characters numerical
digits?
Are the last three CC12345
characters letters/upper
case letters?
(4)

Question Answer Additional Guidance Mark


2(b)(i) 24.0 (1) Accept 24
(1)
2(b)(ii) One of:
By the rules of precedence multiplication is done before
addition. (1)
Without the brackets the addition would be done to the total
of the multiplication. (1)
By the rules of the BODMAS/BIDMAS additions happen after
multiplication. (1)
newSpeed and intialSpeed have to be added together before
multiplying (by time). (1)
(1)
Question Answer Additional Guidance Mark
2(b)(iii) Real (1) Accept double / float
Because real x integer = real (1) Accept ‘because it could be a number with decimal
places’ (2)
2(b)(iv) 27.375 (1)
(1)
Q2(c)(i)
C#: 16 or 20 (1)
Java: 16 or 21 (1)
Python: 8 or 10 (1)
(1)
Q2(c)(ii)
C#: 29 or 31 (1)
Java: 24 or 26 (1)
Python: 14 or 15 (1)
(1)
Q2(c)(iii) Any of:
1. Message (1)
2. startPos (Python) / pos (Java or C#) (1)
3. characters (1) (1)
Q2(c)(iv) newMessage (1) Do not accept outMessage (1)
Q2(c)(v) Response starts with ‘c’ (1) Marks can be awarded from Q2(c)(vi)
Response has six letters in sequence from ‘educational’ (1) (2)
Q2(c)(vi) 1. Returns substring / crops a string (1) Award two marks for:
2. Located between the two input values / with number of It produces a substring of the message starting at
characters identified in the last parameter (characters) position startPos with length characters
and starting at the second parameter (startPos) (1) Award up to 2 marks for a correct interpretation of the
code (e.g ‘obtain a newMessage’ – is worth 1)
Accept a correct generic explanation of what a
subprogram does for 1 mark (2)
Question Answer Additional Guidance Mark
Q3(b) More memory/storage required (1)
Because not sorted in place / not efficient / many steps /
division of data set / is recursive (1) (2)

Question Answer Additional Guidance Mark


4(a) The only correct answer is D

A is not correct because Plaintext is the original unencrypted


text
B is not correct because there is a consistency in the coding of
the text
C is not correct because a shift encryption replaces letters
with other letters a given distance from the original letter (as
in a Caesar cipher) 1
4(b) Award 3 marks for all rows correct
Award 2 marks for 4 rows correct
Award 1 mark for 2 rows correct

G
Q
I
X
N
U
(3)
Q4(c) One mark for correct decision: Award marks independently
Yes (1)
Up to two marks for the correct justifications:
Each/every letter has a symbol / is represented (1)
The symbol is a single/unique representation (1) (3)
Question Answer Additional Guidance Mark
1(c) C# Candidates are required to open the file Q01c in (3)
1. Semicolon at the end of line 9 [maxValue=5;] (1) the code editor.
2. Consistent capitalisation of ‘count’ on lines 10, 11, 13 and 14 (1) Amended code should be saved as
3. constantValue needs to be defined and given the value 7 / Q01cFINISHED.
replaced by value 7 (1) Line numbers may have been changed by
Java corrections to code (e.g. insertion of
1. Semicolon at the end of line 8 [maxValue = 5;] (1) constantValue definition)
2. Consistent capitalisation of ‘count’ on lines 7, 9, 11 and 12 (1)
3. constantValue needs to be defined and given the value 7 /
replaced by 7 (1)
Python
1. Colon needed at end of line 7 [count, maxValue):] (1)
2. Consistent capitalisation of ‘count’ on line 3, 7, 8 and 9 (1)
3. constantValue needs to be defined and given the value 7 /
replaced by 7 (1)

Question Answer Additional Guidance Mark


1(f) Award 1 mark for each correct pair of relational operators and 1 mark for correct Candidates are required to open
Boolean operator for each condition. the file Q01f in the code editor.
Amended code should be saved as
Condition Coding Q01fFINISHED.
Shop income more than £5000 shopIncome > 5000; assistantSales >= 10 (1) Do not penalise candidates who
or assistant sold at least 10 pairs correct OR operator (1) attempt more than the stated
Shop income at least £2000 and shopIncome >= 2000; assistantSales >= 5 (1) requirements.
assistant sold at least 5 pairs correct AND operator (1) Do not award Boolean operator
mark for single | or & as these are
Accept >9, >1999 and >4 for respective >= comparisons not correct.
(4)
Question Answer Additional Guidance Mark
2(a) Award 1 mark for each of: Candidates are required to open the file Q02a in the
1. set counter to 1 and guess to 0 (1) code editor.
2. set answer to random value between 1 and 10 (1) Amended code should be saved as Q02aFINISHED.
3. request input of and accept an integer value for guess (1) Logic of algorithm must be followed as set out.
4. create a while loop with a correct condition (1) Alternatives must address each point.
5. increment the counter (1) Do not penalise candidates who attempt more than
6. use if else selection to determine and display appropriate the stated requirements.
output message for incorrect guesses (1)
7. request input of and accept another integer value for a
guess inside the loop (1)
8. display correct guess and count of guesses (1)
9. compiling without syntax errors (1)
10. coding meets all requirements of question (1) (10)

Question Answer Additional Guidance Mark


Q3(a) Award 1 mark each for: Amended code should be saved as Q03aFINISHED.
1. File opened for input (1) Do not penalise candidates who attempt more than
2. File opened for output (1) the stated requirements.
3. Loop for processing data (1)
4. Check for ‘@’ symbol (1)
5. Write invalid address to output file (1)
6. Close files (1) (6)
Question Answer Additional Guidance Mark
Q3(c) Award 1 mark for each section of code that: Amended code should be saved as Q03cFINISHED.
1. Asks for input of a number and stores it in a variable
with a meaningful name (1) Allow follow through for mark point 4 when square and
2. Checks number is between 1 and 50 (1) cube are incorrectly calculated.
3. Calculates square and cube of number (1)
4. Displays suitable labels e.g. ‘Number’, ‘Square’ and Credit alternative coding which produces same results.
‘Cube’ and relevant values (1)
For the whole code: Accept use of exponent operators:
5. Compiles and runs without logical or syntax errors (1) C# e.g. Math.Pow (2, 3) = 8
6. Efficient in terms of computation, storage and selection Java e.g. Math.pow (2, 3) = 8
of programming constructs (1) Python e.g. 2**3 = 8.
(6)

Question Designated marks: Additional Guidance Mark


Q5 Designated marks: Award marks
independently
1. Initialise variables for at least two of total number of books, count of pupils and average
2. Initialise variables for gold, silver and bronze / sort array in order of books read
Award marks for
3. Create loop for identifying (and printing) those borrowing fewer than 10 books
reasonable attempt to
4. Print out appropriate details (must include pupil ID)
meet requirement.
5. Print out total of books borrowed
6. Print out average number of books borrowed
7. Identification of gold medal winner
8. Identification of silver medal winner
9. Identification of bronze medal winner
10. Details of at least one of gold, silver and bronze medal winner printed (minimum last
name or first name)
11. Details of all three medal winners (first name and last name) (11)
Question 5 Overview marks:
Mark Band 0 Mark Band 1 Mark Band 2 Mark Band 3 Marks
0 1–3 4–6 7–9
No Little attempt to decompose the Some attempt to decompose the The problem has been decomposed
rewardable problem into component parts problem into component parts into component parts
content
Some parts of the logic are clear and Most parts of the logic are clear and The logic is clear and appropriate to
appropriate to the problem mostly appropriate to the problem the problem

Some appropriate use and The use and manipulation of data The use and manipulation of data
manipulation of data types, types, variables and data structures types, variables and data structures
variables, data structures and and program constructs is mostly and program constructs is
program constructs appropriate appropriate

Parts of the code are clear and Code is mostly clear and readable Code is clear and readable
readable

Finished program will not be flexible Finished program will function with Finished program could be used
enough with other data sets or input some but not all other data sets or with other data sets or input
input

The program meets some of the The program meets most of the The program fully meets the given
given requirements given requirements requirements
(9)
C# Example code
1(c)

1(f)
2(a)
3(a)
3(c) Note: Line 19 is an alternative response to line 18
5
Java Example code

1(c)

1(f)
2(a)
3(a)
3(c) Note: Line 19 is an alternative response to line 18
5
Python Example code

1(c)

1(f)
2(a)
3(a)
3(c)

Note: Line 11 is an alternative response to line 9.


5
Pearson Education Limited. Registered company number 872828
with its registered office at 80 Strand, London, WC2R 0RL, United Kingdom
Please check the examination details below before entering your candidate information
Candidate surname Other names

Centre Number Candidate Number


Pearson Edexcel
International GCSE (9–1)

Monday 18 May 2020


Afternoon (Time: 2 hours) Paper Reference 4CP0/01

Computer Science
Paper 1: Principles of Computer Science

You must have: Total Marks


Pseudocode command set (enclosed)

Instructions
• Use black ink or ball-point pen.
• centrethe
Fill in boxes at the top of this page with your name,
number and candidate number.
• Answer all questions.
• Answer the questions in the spaces provided
– there may be more space than you need.

Information
• The total mark for this paper is 80.
• The marks for each question are shown in brackets
– use this as a guide as to how much time to spend on each question.
• You are not allowed to use a calculator.
Advice
• Read each question carefully before you start to answer it.
• Try to answer every question.
• Check your answers if you have time at the end.
• further explanation.
Marks will not be awarded for using product or trade names in answers without

Turn over

*P61884RRA0120*
P61884RRA
©2020 Pearson Education Ltd.

1/1/1/1/1/1/1/1
Answer ALL questions. Write your answers in the spaces provided.
Some questions must be answered with a cross in a box . If you change your mind about an
answer, put a line through the box and then mark your new answer with a cross .
1 Upeka manages the network in her office building.
(a) Upeka uses the network to install software updates on all the office computers.
Give two other reasons why computers are connected in a network.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) The network uses wired and wireless connectivity.


(i) State two advantages of using wired rather than wireless connectivity.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) State two disadvantages of using wired rather than wireless connectivity.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2
*P61884RRA0220*
(c) Some people confuse the terms ‘internet’ and ‘world wide web’.
Describe the difference between the internet and the world wide web.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(d) Networks use both IPv4 and IPv6 addresses to identify connected devices.
Explain why IPv6 addressing was introduced.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3
*P61884RRA0320* Turn over
(e) Network layouts can be based upon a number of different network topologies.
Figure 1 shows a network topology.

  
hub or switch

  
Figure 1
(i) State the name of this network topology.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) State one benefit of using this network topology.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) State one drawback of using this network topology.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4
*P61884RRA0420*
(f ) The network uses TCP/IP.
Figure 2 shows the TCP/IP protocol stack.

Application

Transport

Network

Data link

Figure 2
(i) One use of the application layer is to send and receive emails.
State two email protocols.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
(ii) Upeka sends an email to Peter. The transport layer in Upeka’s computer splits
the email into data packets.
State two tasks performed by the transport layer in Peter’s computer when
the packets arrive from the network layer.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 1 = 17 marks)

5
*P61884RRA0520* Turn over
2 Computers use binary digits to represent data.
(a) Sign and magnitude and two’s complement are two ways of representing signed
integer numbers.
(i) Convert the denary number -94 to a binary pattern using sign and magnitude
representation.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) 1000 1001 is a signed integer that uses two’s complement representation.
Convert this signed integer to denary.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) Denary numbers use base 10


Identify the base for hexadecimal numbers.
(1)
A 32

B 16

C 8

D 2

6
*P61884RRA0620*
(c) Computers encode characters using ASCII and Unicode.
(i) State the number of characters that can be represented using standard ASCII.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) The ASCII system uses 7 bits to represent a character. The ASCII code for the
character ‘A’ using denary is 65; other alphabetical characters follow on from
this in sequence.
Identify the ASCII code for ‘H’.
(1)
A 1000111

B 1001010

C 1001000

D 1000101
(iii) Explain why Unicode was developed.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 2 = 9 marks)

7
*P61884RRA0720* Turn over
3 The central processing unit (CPU) and other hardware components work together
with the operating system to run programs and store data.
(a) Here is a partially completed diagram showing the hardware components used in
the fetch-decode-execute cycle.
The function of the I/O controller is to manage communication between the CPU
and input/output devices.
Complete the diagram by:
• labelling the buses
• adding directional arrows to the dotted lines to show the flow of
communication.
(6)

Keyboard Display

CPU
Control Keyboard Display
Clock unit RAM controller controller

bus

bus

bus

(b) The CPU includes an area of cache memory.


Increasing the size of the cache will improve the performance of the CPU.
Explain how increasing the size of the cache improves the performance.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8
*P61884RRA0820*
(c) Some computers have more than one CPU. The CPUs work in parallel to execute
instructions.
Complete the table to show how two CPUs working in parallel could execute the
expression:

(5 * 2) + (4 * 3) – (24 / 4)
(4)

CPU 1 CPU 2

5 * 2 = 10

(d) One function of an operating system is to manage files on secondary storage.


Describe how an operating system manages the storage of a file on random
access secondary storage.
(4)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 3 = 16 marks)

9
*P61884RRA0920* Turn over
4 Ibrahim works in the music industry.
(a) He is learning how sound is represented in binary.
Figure 3 illustrates this process.
7

4
Amplitude

3
A
2 B

0
0 1 2 3 4 5 6 7 8

Seconds

Figure 3
(i) State what the solid line labelled A represents.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) State what the dashed line labelled B represents.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) Give the sampling frequency, including the correct units.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10
*P61884RRA01020*
(iv) Give one impact of increasing the sampling frequency.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(v) The bit-depth measures the resolution of the sound sample.


State the minimum bit-depth needed to store the sound sampled in Figure 3.
Justify your answer.
(2)
Bit-depth

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Justification

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(vi) Give the value in binary of the audio sample at the 4th second.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11
*P61884RRA01120* Turn over
(b) Ibrahim wants to store a music file.
• The sampling frequency is 47 kHz.
• The bit-depth is 64
• The analogue signal lasts for 819 seconds.
Construct an expression to show how the file size, in bytes, is calculated.
You do not need to do the calculation.
(4)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) Ibrahim wants to upload a music file to his online storage. The file has been
compressed using a lossy algorithm.
Give one drawback of using a lossy algorithm for this purpose.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 4 = 12 marks)

12
*P61884RRA01220*
5 Programmers work as part of a team to develop software.
(a) They use truth tables to determine if an expression evaluates to true or false.
Complete this truth table for the Boolean expression
P AND (Q OR R)
You may not need to use all rows.
(3)

P Q R Q OR R P AND (Q OR R)

13
*P61884RRA01320* Turn over
(b) The team is working on software for a ride-on lawn mower.
The lawn mower must not start unless it is safe for the driver.
• The brake (B) must be engaged.
• The driver’s seat sensor (S) must be engaged.
• The blade safety lock (L) must be removed.
Construct a Boolean expression, using AND, OR, and NOT with the letters B, S and
L to show the safe starting condition.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) The team uses code reviews as part of the software development process.
State two ways in which code reviews can help protect software systems from
cyber attacks.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14
*P61884RRA01420*
(d) The team needs to protect its intellectual property rights over the systems that it
develops.
Give three types of legal protection the team could use.
(3)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 5 = 10 marks)

15
*P61884RRA01520* Turn over
6 A software engineer is working with some algorithms.
(a) An algorithm needs to be developed.
The algorithm must:
• check for a change of hour every minute
• use the library subprogram getHour() to get the hour part of the current time
in the 24-hour clock (0 to 23)
• output “Good morning” when the hour is between 3 and 12, inclusive
• output “Good afternoon” when the hour is between 13 and 19, inclusive
• output “Good night” at all other times.
Complete the flowchart to represent this algorithm, in the space provided on the
next page.
The call to the library subprogram getHour() has already been included.
Use this subprogram symbol to show waiting for 1 minute.

wait
1 minute
(6)

16
*P61884RRA01620*
Draw your flowchart here.

START

getHour()

17
*P61884RRA01720* Turn over
(b) Another algorithm determines when to change the flavoured syrups for a drinks
dispensing machine.
Figure 4 shows this algorithm written in pseudocode.

11 SET flavours TO [“anise”, “mango”, “cola”, “apple”, “papaya”, “strawberry”,


“lychee”, “banana”]
12
13 SET volume TO [0.7, 0.2, 0.6, 0.1, 0.05, 0.8, 0.4, 0.6]
14
15 SET i TO 0
16
17 WHILE i < 8 DO
18
19 IF (volume[i] < 0.1) THEN
10 SEND (flavours[i] & “ needs changing”) TO DISPLAY
11
12 ELSE
13 IF (volume[i] >= 0.3) AND (volume[i] <= 0.5) THEN
14 SEND (flavours[i] & “ needs ordering”) TO DISPLAY
15 END IF
16 END IF
17
18 SET i TO i + 1
19
20 END WHILE

Figure 4
(i) Give the output produced by the algorithm.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The algorithm works with a fixed number of flavours.


(ii) Give the number of the line in the algorithm that would need to be amended
to allow for any number of flavours.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18
*P61884RRA01820*
(iii) State how the pseudocode needs to be changed to make this amendment.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

QUESTION 6(c) BEGINS ON THE NEXT PAGE.

19
*P61884RRA01920* Turn over
(c) The algorithms will be coded in a high-level language.
Programs written in high-level languages must be translated in order to be
executed by a computer.
Discuss the similarities and differences between a compiler and an interpreter.
(6)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 6 = 16 marks)

TOTAL FOR PAPER = 80 MARKS

20
*P61884RRA02020*
Mark Scheme (Pre-Standardisation)

November 2020

Pearson Edexcel International GCSE


In Computer Science (4CP0/01)
Paper 1: Principles of Computer Science

1
Edexcel and BTEC Qualifications

Edexcel and BTEC qualifications are awarded by Pearson, the UK’s largest awarding body.
We provide a wide range of qualifications including academic, vocational, occupational
and specific programmes for employers. For further information visit our qualifications
websites at www.edexcel.com or www.btec.co.uk. Alternatively, you can get in touch with
us using the details on our contact us page at www.edexcel.com/contactus.

Pearson: helping people progress, everywhere

Pearson aspires to be the world’s leading learning company. Our aim is to help everyone progress
in their lives through education. We believe in every kind of learning, for all kinds of people,
wherever they are in the world. We’ve been involved in education for over 150 years, and by
working across 70 countries, in 100 languages, we have built an international reputation for our
commitment to high standards and raising achievement through innovation in education. Find out
more about how we can help you and your students at: www.pearson.com/uk

Autumn 2020
Publications Code 4CP0_01_2011_MS
All the material in this publication is copyright
© Pearson Education Ltd 2020

2
General Marking Guidance

• All candidates must receive the same treatment. Examiners


must mark the first candidate in exactly the same way as they
mark the last.
• Mark schemes should be applied positively. Candidates must
be rewarded for what they have shown they can do rather than
penalised for omissions.
• Examiners should mark according to the mark scheme not
according to their perception of where the grade boundaries
may lie.
• There is no ceiling on achievement. All marks on the mark
scheme should be used appropriately.
• All the marks on the mark scheme are designed to be awarded.
Examiners should always award full marks if deserved, i.e. if
the answer matches the mark scheme. Examiners should also
be prepared to award zero marks if the candidate’s response is
not worthy of credit according to the mark scheme.
• Where some judgement is required, mark schemes will provide
the principles by which marks will be awarded and
exemplification may be limited.
• When examiners are in doubt regarding the application of the
mark scheme to a candidate’s response, the team leader must
be consulted.
• Crossed out work should be marked UNLESS the candidate has
replaced it with an alternative response.

3
Question Answer Additional Mark
Number Guidance
1(a) Any two from: • Award
examples if
• (Share) access to the mapped to
Internet/WWW/broadband connection a bullet
(1) point
• (Internal) communication (using • Do not
email/instant messaging/calendars) award the
(1) same bullet
• Share files/data (1) more than
• Share peripherals/printers / hardware once
(1) • Do not
• Increases the amount of storage award for
(since network storage devices can be install
attached) (1) updates (in
• Saves money on licences (since the stem)
network site licences for software are
usually cheaper than buying a stand-
alone licence for every machine) (1)
• Centralised backup (1)
• Centralised security (1)
2

Question Answer Additional Mark


Number Guidance
1(b) (i) Any two from: Accept
reverse
• Faster (data transfer) (1) Not really true, arguments for
its Greater bandwidth / more bits per disadvantages
second (1) of wireless.
• The connection does not get worse the
further you are from the router / more
reliable (1)
• Connection does not get obstructed by
walls, ceilings, and furniture (1)
• More secure (1) 2

4
Question Answer Additional
Number Guidance Mark
1(b) (ii) Any two from: Accept
reverse
• Installation/maintenance is more arguments for
complex (1) advantages of
• Devices need to be physically wireless.
connected (1)
• Less portable / limited by length of
cable (1)
• Limited number of devices can be
connected (1)
• Some digital devices cannot use a wired
connection (1)
• Trip hazard (1) 2
Question Answer Additional Mark
Number Guidance
1(c) Award two marks for a linked description that
addresses the individual mark points:

The internet is a (global) network of networks/


connected devices (1) whereas the www is the
collection of web pages/service accessed using the
internet (1) / the www is resources located via
URLs/domain names (1)

The internet is the infrastructure (1) and the www


is a service that runs on that infrastructure (1) 2

Question Answer Additional Mark


Number Guidance

5
1(d) Award two marks for a linked explanation such as:

Running out of IPv4 addresses/the number of


(internet) connected devices has grown (1)

IPv6 addresses are long/longer than IPv4 / the


number of possible addresses is large/will last
much longer (1) 2

Question Answer Additional Mark


Number Guidance
1(e)(i) Star

Question Answer Additional Mark


Number Guidance
1(e) (ii) Any one from:

• easy to connect/remove new nodes (1)


• failure of one node/link does not affect the
rest of the network (1)
• easy to detect the failure of one node/link
(1) 1

Question Answer Additional Mark


Number Guidance
1(e) (iii) Any one from:

• if central switch/hub fails then the whole


network fails (1)
• performance and number of nodes that can
be added depends on capacity of central
switch/hub (1)
• can require more cable than some of the
other topologies (1) 1

Question Answer Additional Mark


Number Guidance

6
1(f)(i) Any two from:

• SMTP (1)
• IMAP (1)
• POP/POP3 (1) 2

Question Answer Additional Mark


Number Guidance
1(f)(ii) Any two from: Do not
accept
• passes the (reassembled) packets to the receives
application layer (1) from
• check if all packets have arrived (1) network
• determine whether the contents are correct layer (stem)
(1)
• requests resending of lost or damaged
packets (1)
• reassembles packets in correct order/ into
an email (1) 2

7
Question Answer Additional Mark
Number Guidance
2(a)(i) 1101 1110

Award one mark for:


• MSB = 1 (1)
• Rest of pattern correct (1) 2

Question Answer Additional Mark


Number Guidance
2(a)(ii) - (1)
119 (1) 2

Question Answer Additional Mark


Number Guidance
2(b) B 16 1

Question Answer Additional Mark


Number Guidance
2(c)(i) 128 Allow the range
0-127 1

Question Answer Additional Mark


Number Guidance
2(c)(ii) C
1

Question Answer Additional Mark


Number Guidance

8
2(c)(iii) Award two marks for a linked explanation such as:

(Before Unicode existed) there are hundreds of


different encoding systems (1) and no single
encoding system could contain enough characters
to represent all major languages (1)

Standard ASCII only provides 128 different


patterns (1) can’t represent all major
languages/symbols/characters (1)

Unicode uses a minimum of 16 bits (1) so can


represent at least 216 characters (1)

Unicode has very large number of characters (1)


can represent all languages/ASCII was developed
(just) for English (1) 2

9
Question Answer Additional Mark
Number Guidance
3(a)

• Address bus labelled correctly (1)


• Data bus labelled correctly (1)
• Control bus labelled correctly (1)
• Arrow from address bus to RAM (1)
• Bi-Directional arrows from control bus to
keyboard controller (1)
• Arrow points from display controller to
display (1)
6

Question Answer Additional Mark


Number Guidance
3(b) Award two marks for a linked explanation
such as:

The cache stores frequently used


data/instructions (1) so the processor does
not have to wait because cache is checked
before main memory / because RAM is
further away from the processor (1).

It speeds up processing (1) because cache is a


faster type of memory (1). 2

10
Question Answer Additional Mark
Number Guidance
3(c) The second row
expressions can
CPU1 CPU2 be in either
column
5 * 2 = 10 4 * 3 = 12 (1)
22 – 6 = 16
10 + 12 = 22 (1) 24 / 4 = 6 (1) May appear in
either CPU in
22 - 6 = 16 (1) the final row

Question Answer Additional Mark


Number Guidance
3(d) Any four from:

• The OS checks whether sufficient space


is available on the storage (media) for
the file (1).
• The file is broken into blocks (1)
• The blocks are stored in spaces that are
large enough (1)
• OS looks for (fat/ntfs)/ reserves (linux)
(groups of) contiguous blocks (1)
• Blocks can reside anywhere on the
storage (1).
• The OS updates the file allocation table
(with the start location and sequence
number of each block) (1)
• OS sets hard links to files (1) ntfs
• OS updates journal/MFT (1) ntfs/linux
• Metadata about the file such as
read/write permissions, date created
and last accessed is separately stored
(1)
4

11
Question Answer Additional Guidance
Number Mark
4(a)(i) Digital (signal) / converted analogue (signal)
(1) 1

Question Answer Additional Guidance


Number Mark
4(a)(ii) Analogue (signal) / analogue (sound wave) (1) 1

Question Answer Additional Guidance


Number Mark
4(a)(iii) 2 Hertz / hertz /Hz (1) • Do not
penalise
spelling
• Accept 2
samples/cycles
per second 1

Question Answer Additional Guidance


Number Mark
4(a)(iv) Any one mark for:

• The (analogue sound) wave will be


represented more accurately / the
fidelity/quality of the recording is
improved (1)
• The file size will increase / more data
stored (as each sample takes up disk
space) (1) 1

Question Answer Additional Guidance


Number Mark
4(a)(v) • 3 (1)
• The range of sampled sound is from 0-
6. To store 7 distinct values, you need 3
bits (111 binary = 7 denary) (1)
OR graph shows 8 possible
values, 3 bits can store 0 - 7 / 8
values (1) 2

Question Answer Additional Guidance


Number Mark
12
4(a)(vi) Correct binary value 101 (1) Ignore leading zeros

13
Question Answer Additional
Number Guidance
Mark
4(b) 819 seconds * 8 bytes * 47,000 hertz Award
819 x 8 x 47000 equivalent
819 seconds * 64÷8 bytes * 47,000 hertz expressions
818 x 64 x 47000
8

819 (1)
8 or 64÷8 (1)
47,000 (1)
Fully correct expression (1) 4

Question Answer Additional


Number Guidance
Mark
4(c) Any one from:
• The sound quality may be poorer/lower (for
some people) (1)
• Cannot get the original back after compression
(1)
1

14
Question Answer Additional
Number Guidance
Mark
5(a) P Q R Q OR R P AND (Q OR Allow follow
through for
R)
incorrect
0 0 0 0 0 mark point
0 0 1 1 0 2.
0 1 0 1 0
0 1 1 1 0
1 0 0 0 0
1 0 1 1 1
1 1 0 1 1
1 1 1 1 1

Award one mark for each of:


• All possible combinations in columns P, Q and
R (1)
• Correct values in Q or R (1)
• Correct values in final column (1)
3

Question Answer Additional Mark


Number Guidance
5(b) B AND S AND NOT L • Any order and
Award one mark for each of: ignore
NOT L or B AND S (1) brackets
Fully correct (1)
2

Question Answer Additional


Number Guidance
Mark
5(c) Any two of:
• Remove code vulnerabilities in programming
languages (1).
• Eliminate bad programming practices (1). 2

Question Answer Additional


Number Guidance
Mark
5(d) Award one mark each for any of:
• Copyright (1)
• Patent (1)
• Licensing (1)
• Trademark (1) 3

15
16
Question Answer Additional
Number Guidance
Mark
6(a) Indicative content provided
Other solutions do exist and should be awarded 6

Aspect of Marks
Solution 0 1 2 3
Functionality No There are There are There are no
awardable significant errors
minor errors in errors in logic,
content in logic, leadinglogic, leading to leading to an
to an overall an overall overall solution
solution that is solution that is that is fully
non-functional not completely functional
functional
Accuracy of No Notation follows Notation Notation follows
Notation awardable a broadly follows a a recognisable
content unrecognisable recognisable convention and
convention that convention is applied
is applied which is consistently
inconsistently, broadly throughout
although aspects discernible but
of it are is applied
discernible inconsistently

There are a maximum of 3 marks for functionality.


There are a maximum of 3 marks for accuracy of notation.
The marks for functionality and accuracy are awarded independently.

17
18
Question Answer Additional
Number Guidance
Mark
6(b)(i) • papaya needs changing (1)
• lychee needs ordering (1) 2

Question Answer Additional


Number Guidance
Mark
6(b)(ii) 7 (1) 1

Question Answer Additional


Number Guidance
Mark
6(b)(iii) Replace 8 with LENGTH(flavours)/LENGTH(volume) (1) Ignore case
or
If new line
A new line 7: is given
WHILE i < LENGTH(flavours) DO (1) award
or mark if
WHILE i < LENGTH(volume) DO (1) logic is
clear 1

19
Question Answer Mark
Number

20
6(c) Indicative content:

Compiler
• One line of a compiled language maps to multiple
executable instructions
• Reads in a whole file and translates it at once
• Produces an executable file
• Executable file is portable between machines with the
same architecture and operating systems
• End-user cannot see the programming source code
• Does not need an additional environment/software to run
the code

Interpreter
• One line of a compiled language maps to multiple
executable instructions
• Reads, translates, and executes one line at a time
• A special environment is needed to be installed on the
user’s machine to run the code; this is machine specific
• Source code is portable to any machine with an
interpreter which can run on it
• End-user can see the programming source code

Similarities
• One line of a compiled language maps to multiple
executable instructions/one to many relationship to
machine code
• Both are used to interpret high level programming
languages
• Both produce machine code from human-readable
programming code

Differences
• Compiler reads in a whole file and translates it at once.
Interpreter reads, translates and executes one line at a
time
• Compiler produces an executable file, interpreter does
not
• Executable files produced by a compiler will only execute
on machines with the same architecture and operating
systems. Source code produced by an interpreter is
portable to any machine with an interpreter which can
run on it
• Compiled code does not require any additional software 6

21
to execute the code. An interpreter needs a special
environment to be installed on the user’s machine to run
the code; this is machine specific

22
Level Mark Descriptor

0 No rewardable content.
Level 1 1–2 Basic, independent points are made showing elements of knowledge and
understanding of key concepts/principles of computer science.

The discussion will contain basic information with little linkage between
points made.
Level 2 3-4 Demonstrates adequate knowledge and understanding of key
concepts/principles of computer science.

The discussion shows some linkages and lines of reasoning with some
structure.
Level 3 5-6 Demonstrates comprehensive knowledge and understanding by selecting
relevant knowledge and understanding of key concepts/principles of
computer science to support the discussion being presented.

The discussion shows a well-developed, sustained line of reasoning which


is clear, coherent, and logically structured.

23
24
Please check the examination details below before entering your candidate information
Candidate surname Other names

Centre Number Candidate Number


Pearson Edexcel
International GCSE (9–1)

3–5 June 2020


Time: 3 hours Paper Reference 4CP0/02

Computer Science
Paper 2: Application of Computational Thinking
You must have: Total Marks
A computer workstation with appropriate programming language
code editing software and tools, including interpreter/compiler,
CODES folder containing code and data files, pseudocode
command set (enclosed)

Instructions
• Use black ink or ball-point pen.
• centrethe
Fill in boxes at the top of this page with your name,
number and candidate number.
• Answer all questions.
• Answer the questions requiring a written answer in the spaces provided
– there may be more space than you need.
• the
Only one programming language (Python, C# and Java) must be used throughout
test.
• Carry out practical tasks on the computer system and save new or amended code
using the name given in the question with the appropriate file extension.
• Do not overwrite the original code and data files provided to you.
• You must not use the internet during the test.
Information
• The total mark for this paper is 80.
• The marks for each question are shown in brackets
– use this as a guide as to how much time to spend on each question.
• This paper covers Python, C# and Java.
• The invigilatorfolder
The CODES in your user area includes all the code and data files you need.
• will tell you where to store your work.
Advice
• Read each question carefully before you start to answer it.
• Save your work regularly.
• Check your answers if you have time at the end. Turn over

*P61885A0116*
P61885A
©2020 Pearson Education Ltd.

1/1/1/1/1
Answer all questions.
Answer the questions requiring a written answer in the spaces provided.
Some questions must be answered with a cross in a box . If you change your mind about an
answer, put a line through the box and then mark your new answer with a cross .
Carry out practical tasks on the computer system and save new or amended code using the name
given with the appropriate file extension.
Use only ONE programming language throughout the examination.
Indicate the programming language that you are using with a cross in a box .

C# Java Python

1 Computer programs make use of many programming constructs.


(a) Identify which one of these is not an arithmetic operator.
(1)

A add

B divide

C equals

D modulus
(b) State the values used by the Boolean data type.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2
*P61885A0216*
(c) Open Q01c in the code editor.
The program should multiply two integers.
There are three errors in the code.
Amend the code to correct the errors.
Save your amended code as Q01cFINISHED with the correct file extension for the
programming language.
(3)
(d) State what is meant by the term ‘variable’.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(e) Ayesha has written a program that calculates the sum of a set of numbers.
Open Q01e in the code editor.
Answer these questions about the code.
(i) Identify the line number where the code includes a logic operator.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Identify the line number where a subprogram definition starts.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) Identify the name of a numeric variable.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iv) Identify the name of a string variable.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 1 = 10 marks)

*P61885A0316*
3
Turn over
2 Rama wants some computer programs for his daughter, Ayomi.
(a) Rama wants a program to calculate the area of a triangle.
(area of a triangle = ½ base x height)
This pseudocode contains the logic required to create the program.

1 # Initialise variables
2
3 SET base TO 50
4 SET heightChk TO TRUE
5
6 # Print prompt and take input from user
7
8 WHILE heightChk DO
9 SEND “Enter the height (between 1 and 100): “ TO DISPLAY
10 RECEIVE height FROM (INTEGER) KEYBOARD
11 IF (height >= 1 AND height <= 100)
12 THEN heightChk = FALSE
13 END IF
14 END WHILE
15
16 # Calculate and print out values
17
18 SET area TO 0.5 * base * height
19
20 SEND (“Base of triangle is: “ , base) TO DISPLAY
21 SEND (“Height of triangle is: “ , height) TO DISPLAY
22 SEND (“Area of triangle is: “ , area) TO DISPLAY

4
*P61885A0416*
Write a program to implement the logic in the pseudocode.
Open Q02a in the code editor.
You must use the structure given in Q02a to write the program.
Do not add any further functionality.
Save your code as Q02aFINISHED with the correct file extension for the
programming language.
(10)
(b) Ayomi wants a program that will calculate the number of fence panels required to
surround building sites such as the one shown in the diagram (not to scale).

Length

Building site Width

Access
point

Each building site is a rectangle.


Each fence panel is 1 metre long.
A gap of 4 metres is needed to access each site. The location of the gap is not
significant.
The user will input the length and width of the building site as whole numbers of
metres.
The program will output the minimum number of full panels needed.
Q02b provides a structure for the program.
Open Q02b in the code editor.
Write the program.
You must use the structure given in Q02b to write the program.
Do not add any further functionality.
Save your code as Q02bFINISHED with the correct file extension for the
programming language.
(7)

(Total for Question 2 = 17 marks)

*P61885A0516*
5
Turn over
3 Several encryption algorithms have been developed.
(a) State what is meant by the term ‘encryption’.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) Give one reason why data may need to be encrypted.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) (i) Perform a Rail Fence cipher encryption of the text COMPUTATIONAL using a
key of 4.
Show your working.
(4)

Encrypted text:

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6
*P61885A0616*
(ii) Explain one reason why the Rail Fence cipher is a weak encryption algorithm.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 3 = 8 marks)

*P61885A0716*
7
Turn over
4 Gianluca is a schoolteacher. He is in charge of a year group of pupils.
(a) He has started to create a program to analyse test results.
Open Q04a in the code editor.
Amend the code to complete the ‘if statement’ used to produce the outputs
described in this table.

Condition Output text

English test score was less than 40;


Student failed both tests
Maths test score was less than 50
English test score was less than 40 or
Student failed one test
Maths test score was less than 50
English test score was at least 80;
Student passed both tests with distinction
Maths test score was at least 85

Other conditions Student passed both tests

Do not add any further functionality.


Save your code as Q04aFINISHED with the correct file extension for the
programming language.
(6)
(b) Gianluca has started to create a program to analyse pupil attendance.
He wants to use a menu system with subprograms.
Open Q04b in the code editor.
The program must include subprograms to:
• display the names of students whose percentage attendance was less than
75%
• count and display the number of students whose percentage attendance was
90% or higher.
Complete the program code to implement these requirements using the structure
given in Q04b.
Do not add any further functionality.
Save your code as Q04bFINISHED with the correct file extension for the
programming language.
(7)

(Total for Question 4 = 13 marks)

8
*P61885A0816*
5 Cerys Jones is the manager of a shop that sells electrical goods.
She is creating a stock control program.
(a) Each item of stock will have a ten-character code.
Each code consists of three parts.

Part Description

Characters 1 to 3 Uppercase letters

Characters 4 to 9 Numbers between 1 and 9 inclusive

Character 10 ‘e’ or ‘o’ indicating whether the sum of the numbers is even or odd

WAS123456o, FDG232324e and VAC129222e are valid codes.


All codes need to be validated.
Complete the table to show two additional validation tests.
For each test, give one example of erroneous data. The example that you give
should fail only that test.
(4)

Validation test Erroneous data

Is the last character ‘o’ or ‘e’? ABC654321v

(b) Cerys will need an algorithm to search the table of stock data.
(i) State two advantages of using a linear search algorithm rather than a binary
search algorithm.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*P61885A0916*
9
Turn over
(ii) State two disadvantages of using a linear search algorithm rather than a
binary search algorithm.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) Cerys will use functions and procedures in her program.


(i) One similarity between a function and a procedure is that they are both
subprograms.
State two other similarities.
(2)

1 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 ............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Explain one difference between a function and a procedure.


(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 5 = 12 marks)

10
*P61885A01016*
BLANK PAGE

QUESTION 6 BEGINS ON THE NEXT PAGE.

*P61885A01116*
11
Turn over
6 Farshia is the regional manager for an insurance company.
She manages a team of sales staff.
She wants a program to analyse the performance of her team over a number of
months.
Test data has been included in the code.
Open Q06 in the code editor.
Write a program to:
• calculate and display the total sales made by each member of the team
• calculate and display the total sales made by the whole team
• display the first name, last name and the total sales made by the two members
of the team with the highest total sales. (Ignore the possibility of two or more
members of the team having the same total sales.)
Your program should function correctly even if the number of months or
number of members of the team is changed.
Save your code as Q06FINISHED with the correct file extension for the programming
language.
(20)

12
*P61885A01216*
You may use this space for planning / design work.

(Total for Question 6 = 20 marks)

TOTAL FOR PAPER = 80 MARKS

*P61885A01316*
13
BLANK PAGE

14
*P61885A01416*
BLANK PAGE

*P61885A01516*
15
BLANK PAGE

16
*P61885A01616*
Pearson Edexcel Level 1/Level 2 International GCSE (9–1)

3–5 June 2020


Paper Reference 4CP0/02

Computer Science
Component 2
Pseudocode command set

Resource Booklet
Do not return this resource booklet with the question paper.

Turn over

*P61885A*
P61885A
©2020 Pearson Education Ltd.

1/1/1/1/1
Pseudocode command set
Questions in the written examination that involve code will use this pseudocode
for clarity and consistency. However, students may answer questions using any valid
method.
Data types
INTEGER
REAL
BOOLEAN
CHARACTER
Type coercion
Type coercion is automatic if indicated by context. For example 3 + 8.25 = 11.25
(integer + real = real)
Mixed mode arithmetic is coerced like this:

INTEGER REAL

INTEGER INTEGER REAL

REAL REAL REAL

Coercion can be made explicit. For example, RECEIVE age FROM (INTEGER) KEYBOARD
assumes that the input from the keyboard is interpreted as an INTEGER, not a STRING.
Constants
The value of constants can only ever be set once. They are identified by the keyword
CONST. Two examples of using a constant are shown.
CONST REAL PI
SET PI TO 3.14159
SET circumference TO radius * PI * 2
Data structures
ARRAY
STRING
Indices start at zero (0) for all data structures.
All data structures have an append operator, indicated by &.
Using & with a STRING and a non-STRING will coerce to STRING. For example, SEND ‘Fred’
& age TO DISPLAY, will display a single STRING of ‘Fred18’.

2
P61885A
Identifiers
Identifiers are sequences of letters, digits and ‘_’, starting with a letter, for example:
MyValue, myValue, My_Value, Counter2
Functions
LENGTH()
For data structures consisting of an array or string.
RANDOM(n)
This generates a random number from 0 to n.
Comments
Comments are indicated by the # symbol, followed by any text.
A comment can be on a line by itself or at the end of a line.
Devices
Use of KEYBOARD and DISPLAY are suitable for input and output.
Additional devices may be required, but their function will be obvious from the context.
For example, CARD_READER and MOTOR are two such devices.
Notes
In the following pseudocode, the < > indicates where expressions or values need to be
supplied. The < > symbols are not part of the pseudocode.

3
P61885A
Turn over
Variables and arrays

Syntax Explanation of syntax Example

SET Counter TO 0
SET Variable TO <value> Assigns a value to a variable.
SET MyString TO ‘Hello world’

Computes the value of an


SET Sum TO Score + 10
SET Variable TO <expression> expression and assigns to
SET Size to LENGTH(Word)
a variable.

Assigns a value to an element SET ArrayClass[1] TO ‘Ann’


SET Array[index] TO <value>
of a one-dimensional array. SET ArrayMarks[3]TO 56

Initialises a one-dimensional
SET Array TO [<value>, …] SET ArrayValues TO [1, 2, 3, 4, 5]
array with a set of values.

SET Array [RowIndex, Assigns a value to an element


SET ArrayClassMarks[2,4] TO 92
ColumnIndex] TO <value> of a two dimensional array.

Selection

Syntax Explanation of syntax Example

IF <expression> THEN IF Answer = 10 THEN


If <expression> is true then
<command> SET Score TO Score + 1
command is executed.
END IF END IF

IF <expression> THEN IF Answer = ‘correct’ THEN


If <expression> is true then first
<command> SEND ‘Well done’ TO DISPLAY
<command> is executed,
ELSE ELSE
otherwise second
<command> SEND ‘Try again’ TO DISPLAY
<command> is executed.
END IF END IF

4
P61885A
Repetition

Syntax Explanation of syntax Example

WHILE <condition> DO Pre-conditioned loop. Executes WHILE Flag = 0 DO


<command> <command> whilst SEND ‘All well’ TO DISPLAY
END WHILE <condition> is true. END WHILE
Post-conditioned loop.
REPEAT Executes REPEAT
<command> <command> until <condition> SET Go TO Go + 1
UNTIL <expression> is true. The loop must execute UNTIL Go = 10
at least once.
Count controlled loop. The
REPEAT <expression> TIMES REPEAT 100-Number TIMES
number of times <command>
<command> SEND ‘*’ TO DISPLAY
is executed is determined by
END REPEAT END REPEAT
the expression.
FOR <id> FROM <expression>
Count controlled loop. FOR Index FROM 1 TO 10 DO
TO
Executes SEND ArrayNumbers[Index]
<expression> DO
<command> a fixed number of TO DISPLAY
<command>
times. END FOR
END FOR
FOR <id> FROM <expression>
TO FOR Index FROM 1 TO 500 STEP
<expression> STEP Count controlled loop using 25 DO
<expression> DO a step. SEND Index TO DISPLAY
<command> END FOR
END FOR

SET WordsArray TO [‘The’, ‘Sky’,


‘is’, ‘grey’]
FOR EACH <id> FROM SET Sentence to ‘‘
Count controlled loop.
<expression> DO FOR EACH Word FROM
Executes for each element of
<command> WordsUArray DO
an array.
END FOREACH SET Sentence TO Sentence &
Word & ‘ ‘
END FOREACH

5
P61885A
Turn over
Input/output

Syntax Explanation of syntax Example

SEND ‘Have a good day.’ TO


SEND <expression> TO DISPLAY Sends output to the screen.
DISPLAY

RECEIVE Name FROM (STRING)


KEYBOARD
RECEIVE <identifier> FROM
RECEIVE LengthOfJourney
(type) Reads input of specified type.
FROM (INTEGER) CARD_READER
<device>
RECEIVE YesNo FROM
(CHARACTER) CARD_READER

File handling

Syntax Explanation of syntax Example

Reads in a record from a <file>


and assigns to a <variable>.
READ <File> <record> READ MyFile.doc Record
Each READ statement reads a
record from the file.
Writes a record to a file.
WRITE MyFile.doc Answer1,
WRITE <File> <record> Each WRITE statement writes a
Answer2, ‘xyz 01’
record to the file.

Subprograms

Syntax Explanation of syntax Example

PROCEDURE CalculateAverage
PROCEDURE <id>
(Mark1, Mark2, Mark3)
(<parameter>, …)
BEGIN PROCEDURE
BEGIN PROCEDURE Defines a procedure.
SET Avg to (Mark1 + Mark2 +
<command>
Mark3)/3
END PROCEDURE
END PROCEDURE
FUNCTION AddMarks (Mark1,
FUNCTION <id>
Mark2, Mark3)
(<parameter>, …)
BEGIN FUNCTION
BEGIN FUNCTION
Defines a function. SET Total to (Mark1 + Mark2 +
<command>
Mark3)/3
RETURN <expression>
RETURN Total
END FUNCTION
END FUNCTION
Calls a procedure or a
<id> (<parameter>, …) Add (FirstMark, SecondMark)
function.

6
P61885A
Arithmetic operators

Symbol Description

+ Add

- Subtract

/ Divide

* Multiply

^ Exponent

MOD Modulo

DIV Integer division

Relational operators

Symbol Description

= equal to

<> not equal to

> greater than

>= greater than or equal to

< less than

<= less than or equal to

Logical operators

Symbol Description

Returns true if both conditions


AND
are true.
Returns true if any of the
OR
conditions are true.
Reverses the outcome of the
NOT expression; true becomes false,
false becomes true.

7
P61885A
Turn over
BLANK PAGE

8
P61885A
Mark Scheme (Results)

November 2020

Pearson Edexcel International GCSE


In Computer Science (4CP0/2A)
Paper 2: Application of Computational
Thinking

1 of 16
Edexcel and BTEC Qualifications

Edexcel and BTEC qualifications are awarded by Pearson, the UK’s largest awarding body. We
provide a wide range of qualifications including academic, vocational, occupational and specific
programmes for employers. For further information visit our qualifications websites at
www.edexcel.com or www.btec.co.uk. Alternatively, you can get in touch with us using the details
on our contact us page at www.edexcel.com/contactus.

Pearson: helping people progress, everywhere

Pearson aspires to be the world’s leading learning company. Our aim is to help everyone progress
in their lives through education. We believe in every kind of learning, for all kinds of people,
wherever they are in the world. We’ve been involved in education for over 150 years, and by
working across 70 countries, in 100 languages, we have built an international reputation for our
commitment to high standards and raising achievement through innovation in education. Find out
more about how we can help you and your students at: www.pearson.com/uk

Autumn 2020
Publications Code 4CP0_2A_2011_MS
All the material in this publication is copyright
© Pearson Education Ltd 2020

2 of 16
General Marking Guidance

• All candidates must receive the same treatment. Examiners must


mark the first candidate in exactly the same way as they mark the
last.
• Mark schemes should be applied positively. Candidates must be
rewarded for what they have shown they can do rather than
penalised for omissions.
• Examiners should mark according to the mark scheme not according
to their perception of where the grade boundaries may lie.
• There is no ceiling on achievement. All marks on the mark scheme
should be used appropriately.
• All the marks on the mark scheme are designed to be awarded.
Examiners should always award full marks if deserved, i.e. if the
answer matches the mark scheme. Examiners should also be
prepared to award zero marks if the candidate’s response is not
worthy of credit according to the mark scheme.
• Where some judgement is required, mark schemes will provide the
principles by which marks will be awarded and exemplification may
be limited.
• When examiners are in doubt regarding the application of the mark
scheme to a candidate’s response, the team leader must be
consulted.
• Crossed out work should be marked UNLESS the candidate has
replaced it with an alternative response.

3 of 16
Mark Scheme - Theory
Question mp Answer Additional Guidance Mark
1 (a) A1 C (equals) (1) (1)

Question mp Answer Additional Guidance Mark


1 (b) B1 Award one mark for any of: Ignore capitalisation

• TRUE and FALSE (1)


• Yes and No (1)
• T and F (1)
• 0 and 1 (1) (1)

Question mp Answer Additional Guidance Mark


1 (d) D1 Award one mark for any of:

• (Symbolic name associated


with) a value that may be
changed (1)
• A container used to store
data (1)
• A data store whose contents
can change whilst a program
is executing (1) (1)

Question mp Answer Additional Guidance Mark


1 (e) (i) E1 Python 6
C# 12
Java 8 (1)
1 (e) (ii) E2 Python 3
C# 7
Java 3 (1)
1 (e) (iii) E3 Award one mark for any of: Accept listNumbers or
numArray
• amount (1)
• x (1)
• total (1)
• count (1) (1)
1 (e) (iv) E4 message (1)

4 of 16
Question mp Answer Additional Mark
Guidance
3 (a) A1 Award one mark for any of: Accept alternative
wording
• Conversion of plain text into
cipher (1)
• Converting information/data
into a code (1)
• Converting information/data
into an unreadable format (1) (1)

Question mp Answer Additional Mark


Guidance
3 (b) B1 Award one mark for any of: Accept alternative
similar wording.
• To ensure that the data can Do not accept
only be read by an authorised hacking.
person / can't be read by an
unauthorised person. (1) (1)

Question mp Answer Additional Mark


Guidance
3 (c) (i) C1 Award 4 marks for a correct response:
C2
C3
C4 • CAL|OTTA|MUIN|PO
• PO|MUIN|OTTA|CAL

Award 1 mark each up to a maximum


of 3 for:

• 4 lines of text (1)


• Zigzag arrangement of letters
(1)
• Letters from each line
reproduced / consistent use of
the key 4: GSQTYXEXMSREP/
YKILQPWPEKJWH (1) (4)

Question mp Answer Additional Mark


Guidance
3 (c) (ii) C5 Award 2 marks for a linked
C6
explanation such as:

• Limited number of usable keys


(1) to allow for sufficient
movement of characters / so
can easily be decoded by trial (2)

5 of 16
and error / easy to use brute
force to crack (1)

6 of 16
mp ref Answer Additional Mark
Question Guidance
5 (a) A1 2.1.4 Award 1 mark for each appropriate
A2
A3 validation test (up to 2) and 1 mark for
A4 suitable example of erroneous data
that matches the test e.g.

First 3 characters are Fff123456o


upper case letters
Characters 4 to 9 are FFF101111o
non-zero numbers
Consists of only 10 FFF111111ee
characters
Final character FFF112233o
correct for sum of
numbers
(4)

Question mp ref Answer Additional Mark


Guidance
5 (b) (i) B1 1.1.9 Award 1 mark each for any of: Accept
B2
disadvantages of a
• Simple implementation (1) binary compared
• Can be used for sorted or with a linear
unsorted lists (1) search.
• If the target is at the beginning
of the data structure the search
will be faster than a binary
search (2)
5 (b) (ii) B3 1.1.9 Award 1 mark each for any of: Accept advantages
B4
of a binary
• May need to compare with all compared with a
items in list before search linear search.
complete (1)
• May need longer time for
searching a large list (1) (2)

7 of 16
Question mp ref Answer Additional Mark
Guidance
5 (c) (i) C1 2.6.2 Award 1 mark each up to a maximum
C2
of 2 for:

• Both can use arguments /


parameter passing (1)
• Both can use local variables (1)
• Both can be called from
anywhere within the program
(1)
• Code can be reused without
being rewritten (1)
• Both can be library files (1)
• The code can be independently
tested for both (1) (2)
5 (c) (ii) C3 2.6.2 Award two marks for a linked
C4
explanation such as:

• A function must always return


a result (1) whereas a
procedure does not (1)
• A function interface must have
a data type (1) to signify the
type of data that will be
returned / a procedure does
not need this (1)
• The result of a function must
always be used (either
assigned to a variable or as
part of a condition) (1) whereas
a procedure does not explicitly
return a result to be used (1)
• A function produces
information (1) whereas a
procedure performs a task (1) (2)

8 of 16
Mark Scheme – Python Coding
Question mp ref Answer Additional Guidance Mark
1 (c) C1 2.1.5 Delete space in variable name (1)
C2 2.1.5 Capitalise O in variable name (1)
C3 2.1.5 Correction to print statement (1) (3)
Code example
Python

9 of 16
Question mp ref Answer Additional Guidance Mark
2 (a) A1 2.3.4 Set variable base to 50 or heightChk to true Logic of algorithm must be followed as set
A2 2.2.2 Create WHILE DO loop out.
A3 2.4.1 Request input of height Alternatives must address each point.
A4 2.2.2 if statement checks if height >= 1 or <= 100 Do not penalise candidates who attempt
A5 2.2.2 if statement checks if height is >= 1 and <=100 more than the stated requirements.
A6 2.2.2 heightCheck set to false if condition is met Don’t penalise spelling mistakes and
A7 2.5.1 Set area using given formula (0.5 x base x height) alternative wording of the output.
A8 2.4.1 Display one of base, height and area with appropriate label
or displays two of base, height and area without labels
A9 2.4.1 Display all of base, height and area with appropriate labels
A10 1.1.6 Executing and producing correct output (10)
Code example
Python

10 of 16
Question mp ref Answer Additional Guidance Mark
2 (b) B1 2.2.1 Meaningful variable names used (1) The code example shown is one way of
B2 2.4.1 Meaningful prompts for input (1) responding to the task. Other methods
B3 2.4.1 Input of length and width as whole numbers (1) should be credited accordingly.
B4 2.5.1 Perimeter calculated (= 2 x length + 2 x width) (1)
B5 2.5.1 Gap deducted from perimeter (1)
B6 2.4.1 Meaningful output (1)
B7 2.1.1 Code is fit for purpose. Must have mark points 1-6 and be
easy to read (1) (7)
Code example
Python

11 of 16
Question mp ref Answer Additional Guidance Mark
4 (a) A1 2.5.2 english < 40, maths < 50 (1)
A2 2.5.3 Use of and operator in IF (1)
A3 2.5.2 english < 40, maths < 50 (1)
A4 2.5.3 Use of or operator in ‘else if 1’ (1)
A5 2.5.2 english >= 80 AND maths >=85 (1)
A6 2.5.3 Correct completion of final else with messageIndex = 3 (1) (6)
Code example
Python

12 of 16
Question mp ref Answer Additional Guidance Mark
4 (b) B1 2.2.2 Loop checks each pupil for low attendance
B2 2.1.6 Display of name of low attendances
B3 2.3.1 Counter for high attenders initialised
B4 2.2.2 Loop uses correct comparison (>=)
B5 2.6.2 Number of high attenders displayed correctly
B6 2.6.3 Subprogram for option 1 called correctly
B7 2.6.3 Subprogram for option 2 called correctly (7)
Code example
Python

13 of 16
For Q6, the first 11 marks are for coding that matches requirements of task. The remaining 9 marks should be allocated on a best fit.

Question mp ref Answer Additional Guidance Mark


6 A1 2.2.1 Initialise variable for total sales by member
of staff (1)
A2 2.5.1 Add succeeding months’ sales to total sales
(1)
A3 2.1.6 Display total sales by member of staff (1)
A4 2.2.2 Loop repeats for each member of staff (1)
A5 2.2.1 Running team total sales initialised (1)
A6 2.2.2 Add succeeding individual staff sales to
team total (1)
A7 2.1.6 Display final running total (1)
A8 2.1.6 Staff member with highest individual sales
identified (1)
A9 2.1.6 Staff member with second highest
individual sales identified (1)
A10 2.1.6 Information about staff with highest sales
displayed (1)
A11 2.1.6 Information about staff with second
highest sales displayed (1) (11)

14 of 16
Band 1 (1-3 marks) Band 2 (4-6 marks) Band 3 (7-9 marks) Mark
Little attempt to decompose the problem Some attempt to decompose the problem The problem has been decomposed into
into component parts into component parts component parts
Some parts of the logic are clear and Most parts of the logic are clear and mostly The logic is clear and appropriate to the
appropriate to the problem appropriate to the problem problem
Some appropriate use and manipulation of The use and manipulation of data types, The use and manipulation of data types,
data types, variables, data structures and variables and data structures and program variables and data structures and program
program constructs constructs is mostly appropriate constructs is appropriate
Parts of the code are clear and readable Code is mostly clear and readable Code is clear and readable
Finished program will not be flexible Finished program will function with some Finished program could be used with other
enough with other data sets or input but not all other data sets or input data sets or input
The program meets some of the given The program meets most of the given The program fully meets the given
requirements requirements requirements (9)

15 of 16
Code example
Python

16 of 16
Please check the examination details below before entering your candidate information
Candidate surname Other names

Centre Number Candidate Number


Pearson Edexcel
International GCSE (9–1)

Time 2 hours
Paper
reference 4CP0/01
Computer Science
PAPER 1: Principles of Computer Science

You must have: Total Marks


Pseudocode command set (enclosed)

Instructions
• Use black ink or ball-point pen.
• Fill in the boxes at the top of this page with your name,
centre number and candidate number.
• Answer all questions.
• Answer the questions in the spaces provided
– there may be more space than you need.

Information
• The total mark for this paper is 80.
• – usemarks
The for each question are shown in brackets
this as a guide as to how much time to spend on each question.
• You are not allowed to use a calculator.
Advice
• Read each question carefully before you start to answer it.
• Try to answer every question.
• Check your answers if you have time at the end.
• Marks will not be awarded for using product or trade names in answers without
giving further explanation.
• Good luck with your examination.
Turn over

*P66489A0120*
P66489A
©2021 Pearson Education Ltd.

1/1/1/1/
Answer ALL questions. Write your answers in the spaces provided.

Some questions must be answered with a cross in a box . If you change your mind about an
answer, put a line through the box and then mark your new answer with a cross .

1 Binary digits (bits) are grouped together to represent different types of data.

(a) Hexadecimal notation is sometimes used to represent patterns of binary digits.

Identify one reason why programmers use hexadecimal notation.


(1)
A Easier for a computer to understand.

B Easier for humans to read.

C Takes up less computer memory.

D Quicker than binary to execute.

(b) Convert the bit pattern 0101 1010 to hexadecimal.


(2)

(c) Identify the number of binary patterns that can be represented by 8 bits.
(1)
A 128

B 256

C 512

D 1024

2
*P66489A0220*
(d) Complete the table by adding these two 8-bit binary integers.
(2)

0 0 1 1 0 0 1 0

0 0 1 1 0 0 1 1

(e) Give the result of performing a logical left shift of 1 place on the binary integer 0100.
(1)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(f ) Give the number of bits per character used by standard ASCII.


(1)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(g) Figure 1 shows a black and white bitmap image.


The pixels in row 5 are represented by the binary pattern 1001 1001

1
2
3
4
5
6
7
8
9

Figure 1

(i) State what is meant by the term pixel.


(1)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Construct an expression to show the number of pixels in the image.


(1)

3
*P66489A0320* Turn over
(iii) The image is changed so that any pixel can be one of 16 different colours.
State the minimum number of bits that would be needed to represent
one pixel.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 1 = 11 marks)

4
*P66489A0420*
2 Many organisations use networks.
(a) One reason for networking computers is to share access to the internet.
Give one other reason for connecting computers in a local area network.
(1)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) State the purpose of network protocols.


(1)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) Data is transmitted in packets.


(i) Identify the layer of the TCP/IP model that would add the File Transfer Protocol (FTP).
(1)
A Application

B Data

C Network

D Transport

(ii) Give one task carried out by the network layer.


(1)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(d) Complete the table by adding a tick () to match each item to its name.
(3)

Domain IP
Item URL
Name Address

https://www.pearson.com

216.33.251.195

pearson.com

5
*P66489A0520* Turn over
(e) Figure 2 shows a network topology.

Figure 2

(i) State the name of this network topology.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) State one benefit of using this network topology.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) State one drawback of using this network topology.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(f ) Files may be compressed using lossless or lossy algorithms.


(i) Music files are distributed over the internet.
Give two reasons why lossy compression is used when distributing music files
over the internet.
(2)

1.............................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.............................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6
*P66489A0620*
(ii) Identify which one of these file formats uses lossy compression.
(1)
A BMP

B DOC

C JPEG

D PNG

(iii) Here is a string of data.


CCCWWWCCWWWWWWCCC
Give the result of compressing the string using a run-length encoding algorithm.
(1)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(g) A video file is to be transmitted over the internet.


• The network transmission speed is 54 Mbps.
• The file size is 6 gigabytes (GB).
Construct an expression to show how the transmission time, in seconds, is calculated.
You do not have to do the calculation.
(4)

(Total for Question 2 = 18 marks)

7
*P66489A0720* Turn over
3 Zakir wants to buy a new laptop.
(a) He knows that a laptop has both hardware and software.
Explain why the laptop needs both hardware and software.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) Zakir needs to choose between a solid state drive and a hard disc drive.
(i) Give two reasons, other than cost and capacity, why Zakir may choose a
solid state drive rather than a hard disc drive.
(2)

1.............................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.............................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Solid state drives store data on flash memory, which is similar to RAM.
Explain one difference between flash memory and RAM.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) One of the laptops has 4 megabytes (MB) of cache memory.


Explain the purpose of cache memory.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8
*P66489A0820*
(d) Zakir uses many devices.
Complete the table by adding one tick () in each row to show whether the
device is an input device, an output device or both.
(2)

Device Input Output Both

Headset

Mouse

Printer

Touch screen

(e) Zakir needs to protect his laptop against malware.


Give two types of anti-malware software he could install.
(2)

1............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 3 = 12 marks)

9
*P66489A0920* Turn over
4 Scientists often use models and simulations.
(a) Give one reason, other than cost, why scientists use simulations.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) Explain one reason why a simulation may require a powerful processor.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) A scientist uses Boolean logic in programs.


Complete the table to show the results of each operation.
(3)

R S W NOT S R AND W (NOT S) OR (R AND W)

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

10
*P66489A01020*
(d) Von Neumann developed the stored program concept.
(i) Describe the stored program concept.
(2)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) The fetch-decode-execute cycle is the cycle the central processing unit (CPU)
follows in order to process instructions.
Name two registers used in the cycle.
(2)

1............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) Describe the role of the address bus and the data bus during the fetch part of
the cycle.
(2)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iv) Complete the table to show the effect on a computer system of increasing the
width of a bus.
(2)

Change made Effect

Increasing the width of the


data bus

Increasing the width of the


address bus

(Total for Question 4 = 14 marks)

11
*P66489A01120* Turn over
5 Isaac is a program developer.
(a) Figure 3 shows an algorithm Isaac has written.

Start

Numbers[0] = 10
Numbers[1] = 6
Numbers[2] = 1
Numbers[3] = 9
Numbers[4] = 3

Count = 0

Length = 4

Midpoint = 2

Temp = 0

No
Stop Count < Midpoint?

Yes
Temp = Numbers[Count]

Numbers[Count] = Numbers[Length − Count]

Numbers[Length − Count] = Temp

Count = Count + 1

Figure 3

12
*P66489A01220*
(i) Complete the trace table. You may not need to use all of the rows.
(5)

Numbers array

Count Length Midpoint Temp [0] [1] [2] [3] [4]

0 4 2 0 10 6 1 9 3

(ii) Give the purpose of the algorithm.


(1)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) Explain why the variable Temp is needed.


(2)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13
*P66489A01320* Turn over
(b) Figure 4 shows an algorithm Isaac has written using pseudocode.
The algorithm should display the average of the numbers that have been input.

1 SET total TO 0
2 SET number TO 0
3 SET count TO 0
4 WHILE number <> −1 DO
5   SEND 'Input a number or −1 to end the program' TO DISPLAY
6    RECEIVE number FROM (INTEGER) KEYBOARD
7    SET total TO total + number
8    SET count TO count + 1
9 END WHILE
10 SET average TO total / count
11 SEND 'The average is ' & average TO DISPLAY

Figure 4

Isaac uses the input 2, 3, 5, 2, −1 to test the algorithm. He discovers an error.

Expected result Actual result

The average is 2.75 The average is 2.2

(i) Explain why the Actual result is not the same as the Expected result.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Give the number of the line that contains the error.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) Amend a single line of pseudocode to correct the error.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14
*P66489A01420*
(c) Isaac is going to sell one of his programs and distribute it on a DVD.
Give two advantages of choosing a programming language that uses a compiler,
rather than an interpreter, for a program that will be distributed on a DVD.
(2)

1............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2............................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 5 = 14 marks)

15
*P66489A01520* Turn over
6 (a) Two emerging technologies are DNA computing and quantum computing.
(i) Explain one difference between DNA computing and traditional computing.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Give a definition of the term superposition in quantum computing.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(b) Ethically, everyone should be able to access the benefits of technology.


Give two reasons why this may not be possible.
(2)

1.............................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.............................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................... ................................................................................................................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16
*P66489A01620*
(c) Widespread use of computer technology has a negative environmental impact.
Discuss the negative environmental impact of using computers and actions that
could be taken to reduce it.
(6)

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

............................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 6 = 11 marks)

TOTAL FOR PAPER = 80 MARKS

17
*P66489A01720*
BLANK PAGE

18
*P66489A01820*
BLANK PAGE

19
*P66489A01920*
BLANK PAGE

20
*P66489A02020*
Pearson Edexcel International GCSE (9–1)
Paper
reference 4CP0/01
Computer Science
Component 1
Pseudocode command set

Resource Booklet
Do not return this resource booklet with the question paper.

Turn over

*P66489A*
P66489A
©2021 Pearson Education Ltd.

1/1/1/1/
Pseudocode command set
Questions in the written examination that involve code will use this pseudocode
for clarity and consistency. However, students may answer questions using any valid
method.
Data types
INTEGER
REAL
BOOLEAN
CHARACTER
Type coercion
Type coercion is automatic if indicated by context. For example 3 + 8.25 = 11.25
(integer + real = real)
Mixed mode arithmetic is coerced like this:

INTEGER REAL

INTEGER INTEGER REAL

REAL REAL REAL

Coercion can be made explicit. For example, RECEIVE age FROM (INTEGER) KEYBOARD
assumes that the input from the keyboard is interpreted as an INTEGER, not a STRING.
Constants
The value of constants can only ever be set once. They are identified by the keyword
CONST. Two examples of using a constant are shown.
CONST REAL PI
SET PI TO 3.14159
SET circumference TO radius * PI * 2
Data structures
ARRAY
STRING
Indices start at zero (0) for all data structures.
All data structures have an append operator, indicated by &.
Using & with a STRING and a non-STRING will coerce to STRING. For example, SEND ‘Fred’
& age TO DISPLAY, will display a single STRING of ‘Fred18’.

2
P66489A
Identifiers
Identifiers are sequences of letters, digits and ‘_’, starting with a letter, for example:
MyValue, myValue, My_Value, Counter2
Functions
LENGTH()
For data structures consisting of an array or string.
RANDOM(n)
This generates a random number from 0 to n.
Comments
Comments are indicated by the # symbol, followed by any text.
A comment can be on a line by itself or at the end of a line.
Devices
Use of KEYBOARD and DISPLAY are suitable for input and output.
Additional devices may be required, but their function will be obvious from the context.
For example, CARD_READER and MOTOR are two such devices.
Notes
In the pseudocode on the following pages, the < > indicates where expressions or values
need to be supplied. The < > symbols are not part of the pseudocode.

3
P66489A
Turn over
Variables and arrays

Syntax Explanation of syntax Example

SET Counter TO 0
SET Variable TO <value> Assigns a value to a variable.
SET MyString TO ‘Hello world’

Computes the value of an


SET Sum TO Score + 10
SET Variable TO <expression> expression and assigns to
SET Size to LENGTH(Word)
a variable.

Assigns a value to an element SET ArrayClass[1] TO ‘Ann’


SET Array[index] TO <value>
of a one-dimensional array. SET ArrayMarks[3]TO 56

Initialises a one-dimensional
SET Array TO [<value>, …] SET ArrayValues TO [1, 2, 3, 4, 5]
array with a set of values.

SET Array [RowIndex, Assigns a value to an element


SET ArrayClassMarks[2,4] TO 92
ColumnIndex] TO <value> of a two dimensional array.

Selection

Syntax Explanation of syntax Example

IF <expression> THEN IF Answer = 10 THEN


If <expression> is true then
<command> SET Score TO Score + 1
command is executed.
END IF END IF

IF <expression> THEN IF Answer = ‘correct’ THEN


If <expression> is true then first
<command> SEND ‘Well done’ TO DISPLAY
<command> is executed,
ELSE ELSE
otherwise second
<command> SEND ‘Try again’ TO DISPLAY
<command> is executed.
END IF END IF

4
P66489A
Repetition

Syntax Explanation of syntax Example

WHILE <condition> DO Pre-conditioned loop. Executes WHILE Flag = 0 DO


<command> <command> whilst SEND ‘All well’ TO DISPLAY
END WHILE <condition> is true. END WHILE
Post-conditioned loop.
REPEAT Executes REPEAT
<command> <command> until <condition> SET Go TO Go + 1
UNTIL <expression> is true. The loop must execute UNTIL Go = 10
at least once.
Count controlled loop. The
REPEAT <expression> TIMES REPEAT 100-Number TIMES
number of times <command>
<command> SEND ‘*’ TO DISPLAY
is executed is determined by
END REPEAT END REPEAT
the expression.
FOR <id> FROM <expression>
Count controlled loop. FOR Index FROM 1 TO 10 DO
TO
Executes SEND ArrayNumbers[Index]
<expression> DO
<command> a fixed number of TO DISPLAY
<command>
times. END FOR
END FOR
FOR <id> FROM <expression>
TO FOR Index FROM 1 TO 500 STEP
<expression> STEP Count controlled loop using 25 DO
<expression> DO a step. SEND Index TO DISPLAY
<command> END FOR
END FOR

SET WordsArray TO [‘The’, ‘Sky’,


‘is’, ‘grey’]
FOR EACH <id> FROM SET Sentence to “
Count controlled loop.
<expression> DO FOR EACH Word FROM
Executes for each element of
<command> WordsUArray DO
an array.
END FOREACH SET Sentence TO Sentence &
Word & ‘ ‘
END FOREACH

5
P66489A
Turn over
Input/output

Syntax Explanation of syntax Example

SEND ‘Have a good day.’ TO


SEND <expression> TO DISPLAY Sends output to the screen.
DISPLAY

RECEIVE Name FROM (STRING)


KEYBOARD
RECEIVE <identifier> FROM
RECEIVE LengthOfJourney
(type) Reads input of specified type.
FROM (INTEGER) CARD_READER
<device>
RECEIVE YesNo FROM
(CHARACTER) CARD_READER

File handling

Syntax Explanation of syntax Example

Reads in a record from a <file>


and assigns to a <variable>.
READ <File> <record> READ MyFile.doc Record
Each READ statement reads a
record from the file.
Writes a record to a file.
WRITE MyFile.doc Answer1,
WRITE <File> <record> Each WRITE statement writes a
Answer2, ‘xyz 01’
record to the file.

Subprograms

Syntax Explanation of syntax Example

PROCEDURE CalculateAverage
PROCEDURE <id>
(Mark1, Mark2, Mark3)
(<parameter>, …)
BEGIN PROCEDURE
BEGIN PROCEDURE Defines a procedure.
SET Avg to (Mark1 + Mark2 +
<command>
Mark3)/3
END PROCEDURE
END PROCEDURE
FUNCTION AddMarks (Mark1,
FUNCTION <id>
Mark2, Mark3)
(<parameter>, …)
BEGIN FUNCTION
BEGIN FUNCTION
Defines a function. SET Total to (Mark1 + Mark2 +
<command>
Mark3)/3
RETURN <expression>
RETURN Total
END FUNCTION
END FUNCTION
Calls a procedure or a
<id> (<parameter>, …) Add (FirstMark, SecondMark)
function.

6
P66489A
Arithmetic operators

Symbol Description

+ Add

- Subtract

/ Divide

* Multiply

^ Exponent

MOD Modulo

DIV Integer division

Relational operators

Symbol Description

= equal to

<> not equal to

> greater than

>= greater than or equal to

< less than

<= less than or equal to

Logical operators

Symbol Description

Returns true if both conditions


AND
are true.
Returns true if any of the
OR
conditions are true.
Reverses the outcome of the
NOT expression; true becomes false,
false becomes true.

7
P66489A
BLANK PAGE

8
P66489A
Mark Scheme (Results)

Summer 2021

Pearson Edexcel International GCSE


in Computer Science (4CP0_01)
Paper 01: Principles of Computer Science
Edexcel and BTEC Qualifications

Edexcel and BTEC qualifications are awarded by Pearson, the UK’s largest awarding body. We
provide a wide range of qualifications including academic, vocational, occupational and specific
programmes for employers. For further information visit our qualifications websites at
www.edexcel.com or www.btec.co.uk. Alternatively, you can get in touch with us using the details
on our contact us page at www.edexcel.com/contactus.

Pearson: helping people progress, everywhere

Pearson aspires to be the world’s leading learning company. Our aim is to help everyone progress
in their lives through education. We believe in every kind of learning, for all kinds of people,
wherever they are in the world. We’ve been involved in education for over 150 years, and by
working across 70 countries, in 100 languages, we have built an international reputation for our
commitment to high standards and raising achievement through innovation in education. Find out
more about how we can help you and your students at: www.pearson.com/uk

Summer 2021
Question Paper Log Number P66489A
Publications Code 4CP0_01_2106_MS
All the material in this publication is copyright
© Pearson Education Ltd 2021
General Marking Guidance

• All candidates must receive the same treatment. Examiners must mark the first
candidate in exactly the same way as they mark the last.
• Mark schemes should be applied positively. Candidates must be rewarded for what they
have shown they can do rather than penalised for omissions.
• Examiners should mark according to the mark scheme not according to their perception
of where the grade boundaries may lie.
• There is no ceiling on achievement. All marks on the mark scheme should be used
appropriately.
• All the marks on the mark scheme are designed to be awarded. Examiners should
always award full marks if deserved, i.e. if the answer matches the mark
scheme. Examiners should also be prepared to award zero marks if the candidate’s
response is not worthy of credit according to the mark scheme.
• Where some judgement is required, mark schemes will provide the principles by which
marks will be awarded and exemplification may be limited.
• When examiners are in doubt regarding the application of the mark scheme to a
candidate’s response, the team leader must be consulted.
• Crossed out work should be marked UNLESS the candidate has replaced it with an
alternative response.
Question Answer Additional Guidance Mark
Number
1(a) The only correct answer is B

A is not correct because computers only understand


binary

C is not correct because Hex values will be held as


binary so take up the same space

D is not correct because Hex values are held as


binary and so take the same time to execute 1

Question Answer Additional Guidance Mark


Number
1(b) Award one mark for each of: Must be in the
• 5 correct order
• A 2

Question Answer Additional Guidance


Number Mark
1(c) The only correct answer is B

A is not correct because this is the number of binary


patterns that can be represented by 7 bits

C is not correct because this is the number of binary


patterns that can be represented by 9 bits

D is not correct because this is the number of


binary patterns that can be represented by 10 bits 1

Question Answer Additional Guidance Mark


Number
1(d) Award one mark for each nibble

0110 0101 2

Question Answer Additional Guidance Mark


Number
1(e) Award one mark from:

• 01000 (1)
• 1000 (1) 1
Question Answer Additional Guidance Mark
Number
1(f) 7
1

Question Answer Additional Guidance Mark


Number
1(g)(i) Award one mark from:

• The smallest block (of colour) in an image


(1)
• A single dot in a picture (1)
• A picture element (1)
• A single element of a digital screen (1)
1
1(g)(ii) Award one mark from: Accept 72

• 8 x 9 (1)
• 9 x 8 (1) 1
1(g)(iii) 4 1

Question Answer Additional Guidance Mark


Number
2(a) Award one mark from:

• share peripherals/devices (e.g. printers,


scanners) (1)
• communicate (e.g. email, instant
messaging, play games) (1)
• share data (e.g. files/music/videos/backups
on servers) (1)
• deploy/update applications/software(1)
• administrative purposes (e.g. remote
access/desktop) 1

Question Answer Additional Guidance Mark


Number
2(b) Award one mark from: Accept any other
response indicating
• to allow (connected) machines to protocols enable
communicate (1) communication
• to provide the rules of communication between devices
between (networked) devices (1) 1
Question Answer Additional Guidance Mark
Number
2(c)(i) The only correct answer is A

B is not correct because FTP is an application


protocol, which is added in the application layer

C is not correct because FTP is an application


protocol, which is added in the application layer

D is not correct because FTP is an application


protocol, which is added in the application layer 1
2(c)(ii) Award one mark from:

• Adds the source/destination IP address (1)


• Establishes sockets (an IP address followed
by a port number) (1)
• Moves packets onto the next network
node (1)
• Strips the source/destination IP addresses
(when it arrives at its destination) (1)
• Passes the packet to the transport/next
layer (when it arrives at its destination) (1)
• Adds/removes packet headers (1) 1

Question Answer Additional Guidance Mark


Number
2(d) Award one mark for each of:

Domain IP URL
Name Address

3
Question Answer Additional Guidance Mark
Number
2(e)(i) Bus 1
2(e)(ii) Award one mark from:

Easy to connect/remove

devices/computers (in a network) (1)
• Cable cost less / fewer cables needed
(compared to mesh/star topology) (1)
• Easier to plan/setup/maintain (1) 1
2(e)(iii) Award one mark from:

• If the main cable/a terminator fails or gets


damaged the whole network will fail (1)
• The more workstations the slower it gets
(1)
• The more workstations the more collisions
(1)
• Every device ‘sees’ all of the data on the
network (1)

Question Answer Additional Guidance Mark


Number
2(f)(i) Award two marks from:

•Reduces time taken to upload/download


(1)
• Reduces the bandwidth required/cost of
data to upload/download (1)
• (Usually) produces smaller file/reduces
storage (on the web server/device) (1)
• People have a limited hearing range / can’t
tell the difference (1)
• People’s brains will ‘fill in the blanks’ (1) 2
2(f)(ii) The only correct answer is C

A is not correct because it is not compressed

B is not correct because it uses lossless compression

D is not correct because it uses lossless


compression 1
2(f)(iii) Award one mark from:

• 3c3w2c6w3c (1)
• c3w3c2w6c3 (1) 1
Question Answer Additional Guidance Mark
Number
2(g) Award four marks for a correct expression or • Units are not
correct answer required
• Equivalent
Examples of correct expressions: expressions are
6 x 1000 x 1000 x 1000 x 8 (4) accepted
54 x 1000 x 1000 • Allow follow
through for
1000 x 8 (4) incorrect or
9 partial
expressions
888.9 (4)

For an incorrect or partial expression award one


mark for each of:

• Bits to transfer
o 6 x 10003 (1)
o x 8 (or equivalent) (1)

• Speed in bits per second


o 54 x 10002 (1)

• Their bits divided by their speed (1)

4
Question Answer Additional Mark
Number Guidance
3(a) Award two marks for an explanation that includes
hardware and software.

• The laptop is/contains the hardware (1) and the


software allows the user to interact with it (1)
• Hardware gives input and output devices (1)
/memory, storage, cpu, processing ability

• Software allows instructions to be passed to the


hardware (1) so that it can carry out tasks (1)

• Software is the set of instructions (1) that controls


the hardware (1) 2

Question Answer Additional Mark


Number Guidance
3(b)(i) Award two marks from:

• Lighter/thinner (1)
• Less heat generated (1)
• Faster access speed / faster booting of operating
system / faster data transfer/read/write speeds (1)
• Silent operation (1)
• Less power required / longer battery life (1)
• More robust (due to no moving parts) (1) 2
3(b)(ii) Award two marks for a linked explanation such as:

• Flash memory is non-volatile (1) whereas RAM is


volatile (1)
• Flash memory persists even when power is lost (1)
whereas RAM clears its data whenever power is
lost (1)
• Flash memory is used for storage (1) whereas
RAM is used in performing operations on data
taken from storage (1) 2
Question Answer Additional Mark
Number Guidance
3(c) Award two marks for a linked explanation such as:

• Cache memory stores active/commonly used


instructions / cache is a temporary storage (1)
and is used to speed up processing. (1) stop data
transfer bottlenecks between RAM and CPU (1)
2

Question Answer Additional Mark


Number Guidance
3(d) Award one mark for two correct rows.
Award two marks for four correct rows.

Device Input Output Both


Headset 
Mouse 
Printer 
Touch screen 
2

Question Answer Additional Mark


Number Guidance
3(e) Award two marks from: Do not award
tradenames
• Antivirus (1)
• Anti-spyware (1)
• (Software) firewall (1) 2

Question Answer Additional Mark


Number Guidance
4(a) Award one mark from:

• Predict/model outcomes (1)


• Investigate hypotheses (1)
• Run experiments that cannot be run / are
dangerous in real life (1)
• Simulations can be speeded up/slowed down (1) 1
Question Answer Additional
Number Guidance
Mark
4(b) Award two marks from:

• Simulations (may) use/collect large amounts of


data (1)
• Simulations (may) involve a large number of
calculations (1)
• Simulations may need more CPU cycles as the
amount of data grows (1)
• To be of value, the results must be calculated as
quickly as possible (1)
• Calculations may grow exponentially / become
more complex as the simulation runs/is modified
(1)
• Simulation may output complex graphics (e.g.
virtual world) (1) 2

Question Answer Additional Mark


Number Guidance
4(c) Allow follow
NOT S R AND W (NOT S) OR through for
(R AND W) incorrect mark
1 0 1 point 1 and/or
1 0 1 mark point 2
0 0 0
0 0 0
1 0 1
1 1 1
0 0 0
0 1 1

Award one mark for each of:

• Correct values in NOT S column (1)


• Correct values in R AND W column (1)
• Correct values in final column (1)
3
Question Answer Additional Mark
Number Guidance
4(d)(i) Award two marks for a linked description such as: Must include
storage and
• Instructions (and data) are stored in (main) execution for 2
memory (1) marks
• Instructions (and data) are fetched, decoded, and
executed (in a sequence by the CPU) (1) 2
4(d)(ii) Award two marks from:

• Program counter / PC (1)


• Current instruction (register) / CIR (1)
• Memory address (register) / MAR (1)
• Memory buffer/data (register) /MBR/MDR (1)
• Accumulator/ACC (1) 2
4(d)(iii) Award two marks for a linked description such as:

Address of instruction carried on address bus (to main


memory) (1) contents at that address carried back (to the
CPU) on the data bus (1) 2
4(d)(iv) Award two marks from: Do not accept
increases
Change made Effect bandwidth
Increasing the width Increases the number of without further
of the data bus bits/data/ size of word that explanation
can be transferred at one
time / increases rate of
data transfer (1)
Increasing the width Increases the number of
of the address bus memory addresses /
increases the maximum
amount of memory that
can be addressed (1)

2
Question Answer Additional Mark
Number Guidance
5(a)(i) Award five marks for: Ignore any
numbers
• Count column correct (1) that are
• Temp column correct (1) greyed out
• Row 2 Numbers[Count value from row above] swapped with
Temp value (1)
• Row 3 Numbers[Count value from row above] swapped with
Temp value (1)
• All correct (1)

Numbers array
Count Length Midpoint Temp 0 1 2 3 4
0 4 2 0 10 6 1 9 3
1 10 3 10
2 6 9 6

Numbers array
Count Length Midpoint Temp 0 1 2 3 4
0 4 2 0 10 6 1 9 3
1 4 2 10 3 6 1 9 10
2 4 2 6 3 9 1 6 10

5
5(a)(ii) Award one mark from:

• To reverse the contents of the array (1)


• To reverse the order of the numbers (1) 1
5(a)(iii) Award two marks for a linked explanation such as:

• You need to swap the contents of array values (1) and without
Temp one of the values would be lost (1)
2
Question Answer Additional Mark
Number Guidance
5(b)(i) Award two marks for a linked explanation such as:

• Isaac has included the -1 as a number in the addition (1) but


the number has not been added to the count (1)
• Isaac has misunderstood the WHILE loop (1) as it should not
execute after the -1 has been input (1)
• Isaac is expecting the wrong result (1) it should be 3 (1)
• The count is 1 too many as the -1 is counted as a number (1)
and the total is incorrect as 1 is subtracted from the total (1) 2
5(b)(ii) Line 3 (1)
Line 10 (1)
1
5(b)(iii) SET count TO -1 (1) Ignore
SET average TO (total + 1) / (count – 1) brackets if
the
meaning is
clear 1

Question Answer Additional Mark


Number Guidance
5(c) Award two marks from:

• Compiler produces object code to distribute that is


difficult to reverse engineer / no need to distribute
the source code (1)
• Compiler optimises the code / object code (1)
• Program runs faster (as it does not need
translating) (1)
• The target computer has no need to have the
original compiler / does not need an interpreter (1)
• Compiled code is smaller than the original code (1),
which may not fit on the DVD (1) 2
Question Answer Additional Mark
Number Guidance
6(a)(i) Award two marks for a linked explanation such as:

• Uses DNA/biomolecular components (1) rather that


standard hardware/silicon chips (1)
• DNA uses four-character genetic alphabet (1) rather
than binary digits (1)
• DNA uses chemical reactions (1) rather than
electrical states/properties (1)
• DNA computing uses massive parallel
processing/strands (1) to solve problems that
otherwise would take impossible amounts of time (1) 2
6(a)(ii) Award one mark from:

• The ability of a system to be in multiple states at the


same time (1)
• Multiple probabilities at the same time (1)
• One state combines all possibilities (1)
• The state is not known until it is measured (1) 1
Question Answer Additional Mark
Number Guidance
6(b) Award two marks from:

• Some people may not want to use technology (1)


• Some people may not be able to afford to use
technology (1)
• Some people may not have access to the
technology/infrastructure (1)
• Some people may not be allowed access to
technology (1)
• Some people may not be able to use it
(disabilities etc.) (1) 2

Question Answer Additional Mark


Number Guidance
6(c) Indicative content

Impacts
• Pollution (water, air, noise) resulting from the manufacturing
process
• High energy and water volumes needed for the manufacturing
process
• Mineral mining contaminates ground water
• Mineral (copper, gold, silver, lithium) resource depletion
• High energy use to keep machines cool with air conditioning or fans
• Contain toxic components which means computing devices are
hazardous waste
• Batteries (laptop, lithium cells) disposal is hazardous and needs
specialised disposal facilities
• Computing devices sent to landfills contaminate ground and water
resources

Actions
• Check national and local legislation
• Some countries/states/regions require sellers to recycle own waste
• Research recycling facilities to see if e-waste is acceptable
• Find if local/national/regional government agencies charge for
collection and disposal of e-waste
• Find sellers offering exchange old for new + cost purchase options
• Find charities (local, regional) which take donations of old devices
• Turn off machines when not in use to save energy 6
Level Mark Descriptor
0 No rewardable content
Level 1 1-2 Basic independent points are made showing elements of knowledge and
understanding of key concepts/principles of computer science

The discussion will contain basic information with little linkage between
points made.
Level 2 3-4 Demonstrates adequate knowledge and understanding of key
concepts/principles of computer science.

The discussion shows some linkages and lines of reasoning with some
structure.
Level 3 5-6 Demonstrates comprehensive knowledge and understanding by selecting
relevant knowledge and understanding of key concepts/principles of
computer science to support the discussion being presented.

The discussion shows a well-developed, sustained line of reasoning which is


clear, coherent and logically structured.
Pearson Education Limited. Registered company number 872828
with its registered office at 80 Strand, London, WC2R 0RL, United Kingdom
Please check the examination details below before entering your candidate information
Candidate surname Other names

Centre Number Candidate Number


Pearson Edexcel
International GCSE (9–1)

Time 3 hours
Paper
reference 4CP0/02
Computer Science
PAPER 2: Application of Computational Thinking

You must have: Total Marks


A computer workstation with appropriate programming language code
editing software and tools, including a code interpreter/compiler, CODES
folder containing code files, pseudocode command set (enclosed)

Instructions
•• Use black ink or ball-point pen.
Fill in the boxes at the top of this page with your name,

•• Answer
centre number and candidate number.
all questions.
Answer the questions requiring a written answer in the spaces provided

• Only
– there may be more space than you need.
one programming language (Python, C# or Java) must be used throughout

• Carry
the examination.
out practical tasks on the computer system and save new or amended code using

•• DoYounotmustoverwrite
the name given in the question with the appropriate file extension.
the original code and data files provided to you.
not use the internet during the examination.

Information
•• The total mark for this paper is 80.
The marks for each question are shown in brackets

•• This
– use this as a guide as to how much time to spend on each question.
paper covers Python, C# and Java.

• The invigilator will tell you where to store your work.


The CODES folder in your user area includes all the code you need.

Advice
•• Read each question carefully before you start to answer it.

•• Check
Save your work regularly.
your answers if you have time at the end.
Good luck with your examination. Turn over

*P66490A0116*
P66490A
©2021 Pearson Education Ltd.

1/1/1/1
Answer all questions.
Answer the questions requiring a written answer in the spaces provided.
Some questions must be answered with a cross in a box . If you change your mind about an
answer, put a line through the box and then mark your new answer with a cross .
Carry out practical tasks on the computer system and save new or amended code using the
name given with the appropriate file extension.
Use only ONE programming language throughout the examination.
Indicate the programming language that you are using with a cross in a box .

C# Java Python

1 Computer programs make use of many programming constructs.


(a) Identify which one of these is a logic operator.
(1)

A modulus
B OR

C >=

D =
(b) Describe one difference between a one-dimensional array and a
two-dimensional array.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(c) Open Q01c in the code editor.


The program should calculate how many £20 are in £113 and how much is
left over.
There are three errors in the code.
Amend the code to correct the errors.
Save your amended code as Q01cFINISHED with the correct file extension for the
programming language.
(3)

2
*P66490A0216*
(d) Raoul has written a program that counts the number of vowels in a sentence.
Open Q01d in the code editor.
Amend the code by adding a suitable comment (you may need to add more than
one comment to a line):
(i) at the end of the line where there is a relational operator
(1)
(ii) at the end of a line where iteration starts
(1)
(iii) at the end of the line where selection starts
(1)
(iv) at the end of a line where a data structure is initialised.
(1)
Save your amended code as Q01dFINISHED with the correct file extension for
the programming language.

(Total for Question 1 = 10 marks)

3
*P66490A0316* Turn over
2 A book club uses computer applications.
(a) The club wants a program to ensure that logins are valid.
A flowchart for a test version of the program has been designed.
The test version uses:
• a username of bard423
• a password of nX2934?
Here is the flowchart.

Start

Initialise
variables

Enter username and


password

Are username No Display error


and password
message
correct?

Yes

Display welcome
message

Stop

4
*P66490A0416*
Write a program to implement the logic in the flowchart.
Open Q02a in the code editor.
You must use the structure given in Q02a to write the program.
Do not add any further functionality.
Save your code as Q02aFINISHED with the correct file extension for the
programming language.
(11)

5
*P66490A0516* Turn over
(b) The club sells books.
It needs a computer program to monitor:
• the number of books sold
• the amount of profit made.
Q02b provides a structure for the program.
Open Q02b in the code editor.
Amend the code to complete the If statement used to produce the outputs
described in the table.

Condition Output message

Number of books sold is at least 5 and Sales and profit are good this week
profit made is at least 10
Number of books sold is over 20 and Sales and profit are excellent this week
profit made is at least 20
Number of books sold is under 5 or profit Poor performance this week
made is under 5

All other inputs Alert manager

Do not add any further functionality.


Save your code as Q02bFINISHED with the correct file extension for the
programming language.
(4)

6
*P66490A0616*
(c) Boundary testing is an important part of program development.
The boundary value is the most extreme value that will pass the test.
For example, if the boundary condition is no more than 30 then the boundary test
data would be 30.
Complete the test table to show the boundary test data that could be used for
each test.
(3)

Test data Expected output

booksSold
Poor performances this week
profit

booksSold
Sales and profit are good
this week
profit

booksSold
Sales and profit are excellent
this week
profit

(Total for Question 2 = 18 marks)

7
*P66490A0716* Turn over
3 Several encryption algorithms have been developed.
(a) Ahmed has started to create a Caesar cipher encryption program.
Caesar cipher encryption works by giving a number value to a key.
Each letter in a plaintext message is replaced by a new ciphertext letter using
the key.
For example, as shown in the table, a key value of +2 would change the plaintext
message encrypt to the ciphertext message gpetarv.

Plaintext e n c r y p t

Ciphertext g p e t a r v

Ahmed’s program already converts from plaintext to ciphertext.


He wants to extend the program to:
• accept the input of a plaintext message
• accept the input of the key, which must be a positive integer between
1 and 25
• write the generated ciphertext to a text file named Cipher.txt
• display the ciphertext.
Open Q03a in the code editor.
Complete the program code.
You must use the structure given in the file Q03a to complete the program.
Do not add any further functionality.
Save your code as Q03aFINISHED with the correct file extension for the
programming language.
(8)
(b) Explain one reason why the Caesar cipher is a weak encryption algorithm.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8
*P66490A0816*
(c) The Vigenere cipher encrypts plaintext using a series of Caesar ciphers, based on
the letters of a keyword and a Vigenere square.
Figure 1 shows a Vigenere square.

a b c d e f g h i j k l m n o p q r s t u v w x y z
a a b c d e f g h i j k l m n o p q r s t u v w x y z
b b c d e f g h i j k l m n o p q r s t u v w x y z a
c c d e f g h i j k l m n o p q r s t u v w x y z a b
d d e f g h i j k l m n o p q r s t u v w x y z a b c
e e f g h i j k l m n o p q r s t u v w x y z a b c d
f f g h i j k l m n o p q r s t u v w x y z a b c d e
g g h i j k l m n o p q r s t u v w x y z a b c d e f
h h i j k l m n o p q r s t u v w x y z a b c d e f g
i i j k l m n o p q r s t u v w x y z a b c d e f g h
j j k l m n o p q r s t u v w x y z a b c d e f g h i
k k l m n o p q r s t u v w x y z a b c d e f g h i j
l l m n o p q r s t u v w x y z a b c d e f g h i j k
m m n o p q r s t u v w x y z a b c d e f g h i j k l
n n o p q r s t u v w x y z a b c d e f g h i j k l m
o o p q r s t u v w x y z a b c d e f g h i j k l m n
p p q r s t u v w x y z a b c d e f g h i j k l m n o
q q r s t u v w x y z a b c d e f g h i j k l m n o p
r r s t u v w x y z a b c d e f g h i j k l m n o p q
s s t u v w x y z a b c d e f g h i j k l m n o p q r
t t u v w x y z a b c d e f g h i j k l m n o p q r s
u u v w x y z a b c d e f g h i j k l m n o p q r s t
v v w x y z a b c d e f g h i j k l m n o p q r s t u
w w x y z a b c d e f g h i j k l m n o p q r s t u v
x x y z a b c d e f g h i j k l m n o p q r s t u v w
y y z a b c d e f g h i j k l m n o p q r s t u v w x
z z a b c d e f g h i j k l m n o p q r s t u v w x y

Figure 1
Complete the table to perform a Vigenere decryption of the ciphertext message
flmktrwhee using the keyword thirty.
(4)

Encrypted letter f l m k t r w h e e

Keyword letter

Decrypted letter

9
*P66490A0916* Turn over
(d) A user-defined function uses a Vigenere cipher to encrypt plaintext
into ciphertext.
This pseudocode shows how the function is called.
SET ciphertext TO ciphertext & getCipherLetter(keywordLetter, plaintextLetter)
(i) State what would be returned by this function.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) Give the name of one parameter passed to this function.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iii) State what is meant by a built-in subprogram.


(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 3 = 17 marks)

10
*P66490A01016*
4 Zak sells snacks at an after-school club.
(a) He wants a program that will hold details of the products he sells.
The program must:
• generate a five-character product code that:
– starts with the first three letters of the product name
– ends with a random number between 10 and 30
• display the product code followed by the product name.
Open Q04a in the code editor.
Write the program.
You must use the structure given in the file Q04a to complete the program.
Do not add any further functionality.
Save your code as Q04aFINISHED with the correct file extension for the
programming language.
(7)
(b) Zak plans to implement a binary search algorithm to search a table of products.
(i) Explain one advantage of a binary search compared to a linear search.
(2)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11
*P66490A01116* Turn over
(ii) Figure 2 shows an algorithm for a binary search.

1 # Initialise variables
2 SET productSearch TO " "
3 SET startPosition TO 1
4 SET midPosition TO 0
5 SET endPosition TO LENGTH(productList)
6 SET found TO False
7
8 # Print prompts, take and check input from user
9 SEND "Enter the product code" TO DISPLAY
10 RECEIVE productSearch FROM (STRING) KEYBOARD
11 REPEAT
12 midPosition = (startPosition + endPosition) DIV 2
13 IF productList[midPosition] < productSearch THEN
14 startPosition = midPosition + 1
15 END IF
16 IF productList[midPosition] > productSearch THEN
17 endPosition = midPosition – 1
18 END IF
19 UNTIL productList[midPosition] = productSearch OR startPosition = endPosition

Figure 2
This binary search algorithm will be used to search the product list for the
product code str15.
Complete the table to indicate the order in which the product codes will be
examined by the algorithm.
Write the number 1 by the first product code to be examined, 2 by the second
code to be examined, and so on.
(4)

Position in list Product code Order examined

1 ark11

2 asp11

3 bar13

4 dri15

5 mil19

6 rib10

7 str15

8 tor16

12
*P66490A01216*
(iii) Zak has another list containing the names of five students who attend the
after-school club.
Give the maximum number of names that would need to be examined by the
binary search algorithm to determine whether a name appears in the list.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(iv) Give the name of an algorithm that could be used to sort a list.
(1)

................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ............................................................................................................................................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(Total for Question 4 = 15 marks)

13
*P66490A01316* Turn over
5 Bianca has started to write a program.
The program is a guessing game about countries and their capital cities.
Open Q05 in the code editor.
The program already:
• displays this menu

Menu
[1] Add player name
[2] Play guess the capital city
[3] End game

Input your menu choice:

• asks for the user’s menu choice.


Write the program code for the menu choices.
Menu choice [1] Add player name
If a player chooses this option, then they must input a player name.
Menu choice [2] Play guess the capital city
If a player chooses this option, then:
• they must answer five questions
• they select a question to answer by choosing a valid question number
• each question can only be selected once (they must not be able to choose
a number more than once)
• the question should be displayed
• they must input the name of the capital city
• if they guess correctly their score must be incremented by 1
• if they guess incorrectly the correct answer must be displayed.
Menu choice [3] End game
If the user chooses this option, then the player name and score should be displayed.
Your program should function correctly even if the number of countries and
capital cities in the file is increased.
Save your code as Q05FINISHED with the correct file extension for the
programming language.
(20)

14
*P66490A01416*
You may use this space for planning / design work.
The content of this page will not be assessed.

(Total for Question 5 = 20 marks)

TOTAL FOR PAPER = 80 MARKS

15
*P66490A01516*
BLANK PAGE

16
*P66490A01616*
Mark Scheme (Results)

Summer 2021

Pearson Edexcel International GCSE


in Computer Science (4CP0_2A)
Paper 02: Application of Computational
Thinking – Python
Edexcel and BTEC Qualifications

Edexcel and BTEC qualifications are awarded by Pearson, the UK’s largest awarding body. We provide a
wide range of qualifications including academic, vocational, occupational and specific programmes for
employers. For further information visit our qualifications websites at www.edexcel.com or www.btec.co.uk.
Alternatively, you can get in touch with us using the details on our contact us page at
www.edexcel.com/contactus.

Pearson: helping people progress, everywhere

Pearson aspires to be the world’s leading learning company. Our aim is to help everyone progress in their
lives through education. We believe in every kind of learning, for all kinds of people, wherever they are in
the world. We’ve been involved in education for over 150 years, and by working across 70 countries, in 100
languages, we have built an international reputation for our commitment to high standards and raising
achievement through innovation in education. Find out more about how we can help you and your
students at: www.pearson.com/uk

Summer 2021
Question Paper Log Number P66490A
Publications Code 4CP0_2A_2106_MS
All the material in this publication is copyright
© Pearson Education Ltd 2021
General Marking Guidance

• All candidates must receive the same treatment. Examiners must mark the first candidate
in exactly the same way as they mark the last.
• Mark schemes should be applied positively. Candidates must be rewarded for what they
have shown they can do rather than penalised for omissions.
• Examiners should mark according to the mark scheme not according to their perception
of where the grade boundaries may lie.
• There is no ceiling on achievement. All marks on the mark scheme should be used
appropriately.
• All the marks on the mark scheme are designed to be awarded. Examiners should always
award full marks if deserved, i.e. if the answer matches the mark scheme. Examiners
should also be prepared to award zero marks if the candidate’s response is not worthy
of credit according to the mark scheme.
• Where some judgement is required, mark schemes will provide the principles by which
marks will be awarded and exemplification may be limited.
• When examiners are in doubt regarding the application of the mark scheme to a
candidate’s response, the team leader must be consulted.
• Crossed out work should be marked UNLESS the candidate has replaced it with an
alternative response.
Theory Mark Scheme
Question mp Answer Additional Guidance Mark
1 (a) A1 1. The only correct answer is B
A is not correct because as it is an arithmetic operator

C is not correct because as it is a relational operator

D is not correct because as it is a relational operator (1)

Question mp Answer Additional Guidance Mark


1 (b) B1 Award up to 2 marks for a linked description such as: Accept an interpretation
B2

• 1D represents items as a list (1), 2D as a table / 2D as rows and columns (1)


• 1D is a row/column (1), 2D is a table / 2D has rows and columns (1)
• Each element in 1D is a single value (1), each element in 2D is a 1D array (1)
• 1D array can only store one type of element (1). 2D array can store multiple
elements in it (1) (2)

Question mp Answer Additional Guidance Mark


2 (c) Award 1 mark for each set of test data.

Test data Expected results


C1
C2 booksSold Either of Poor performances this week
C3 profit • booksSold = 4
• profit = 4
booksSold 5 Sales and profit are good this week
profit 10
booksSold 21 Sales and profit are excellent this week
profit 20 (3)
Question mp Answer Additional Guidance Mark
3 (b) B1 Award up to 2 marks for a linked explanation such as: Accept alternative similar
wording.
• The number of keys are limited/only one shift used (1) making it easy to use brute
force to decrypt (1)
• It can be easy to find commonly used letters (e.g. E) (1) and guess the key (1) (2)

Question mp Answer Additional Guidance Mark


3 (c) Award 1 mark each up to a maximum of 4 for:

Encrypted letter f l m k t r w h e e
Keyword letter t h i r t y t h i r
Decrypted letter m e e t a t d a w n

C1 Award 1 mark from:


• flmktrwhee mapped to thirtythir (1)
• Flmktr mapped to thirty (1)
C2 At least one letter decrypted correctly (1)
C3 At least one word decrypted correctly (1)
C4 Decrypted message ‘meet at dawn’ (1) (4)

Question mp Answer Additional Guidance Mark


3 (d)(i) D1 Award 1 mark for: Do not accept
word/message/text
• cipherLetter / a single encrypted letter (1) (1)
3 (d)(ii) D2 Award 1 mark for any of: Ignore case

• keywordLetter
• plaintextLetter (1)
3 (d)(iii) D2 Award 1 mark for any of: Must be clear they are
referring to subprogram
• subprogram that is already defined provided by the language
• subprogram that is already written itself
• subprogram that is already compiled
• subprogram that can be called without having to write code for it (1)
Question mp Answer Additional Guidance Mark
4 (b)(i) B1 Award up to 2 marks for a linked explanation:
• binary search can be quicker / is more effective than a linear
search / is more effective with larger lists (1) as it does not have
to examine each item in the list (1)
• binary search halves the list each time (1) so it can be faster to
find an item (1)
• binary search requires fewer comparisons than a linear search
to establish an item is not in the list (1) because the linear list
would need to compare each item before establishing this (1) (2)
4 (b)(ii) Correct answer
Position in list Product code Order examined
1 ark11
2 asp11
3 bar13
4 dri15 1
5 mil19
6 rib10 2
7 str15 3
8 tor16
Award one mark for each correct value in order column (4)
B1 Start of search correct Accept 5 and 7 for B1 and B2 (2 marks)
B2 Second search item correct Follow through if start of search incorrect
B3 Third search item correct Follow through if start of search incorrect
B4 All correct
4 (b)(iii) B5 Award 1 mark for:
3 or log2 n + 1 (1)
4 (b)(iv) B6 Award 1 mark for any of: Accept any known sorting algorithm
• bubble sort
• merge sort (1)
Python Code Mark Scheme
Question mp Answer Additional Guidance Mark
1 (c) C1 Change num_twenties == to num_twenties = (1)
C2 The left over variable named the same in both places (1)
C3 Add + before str(left_over) over in final print statement (1) Accept equivalent e.g.
, (3)

Question mp Answer Additional Guidance Mark


1 (d) (i) D1 Award 1 mark for adding an appropriate comment at the end of the line where there is relational May be on different
operator: line numbers

The comment(s)
added must clearly (1)
1 (d) (ii) D2 Award one mark for adding an appropriate comment at the end of a line where iteration starts: identify the
component

(1)
1 (d) (iii) D3 Award one mark for adding an appropriate comment at the end of the line where selection starts:

(1)
1 (d) (iv) D4 Award one mark for adding an appropriate comment at the end of a line where a data structure is
initialised:

(1)
Question mp Answer Additional Guidance Mark
2 (a) Award one mark for each of: Logic of algorithm must be followed as set out.
A1 At least one variable with a suitable variable name
A2 username = bard423 Alternatives must address each point.
A3 password = nX2934?
A4 Loop used Do not penalise candidates who attempt more
A5 Username or password entered than the stated requirements.
A6 Username or password stored in variable(s)
Do not penalise spelling mistakes in the
A7 At least one suitable input message
assignment of username and/or password
A8 Checks username and password
A9 Appropriate error message(s) displays
Do not penalise spelling mistakes and
A10 Welcome message displayed
alternative wording of the output.
A11 Executing and producing correct output (must have A4) (11)
Code example
Python
Question mp Answer Additional Guidance Mark
2 (b) Award 1 mark for each correct condition. Accept alternatives e.g. Line 11
Condition Output message booksSold <=4 etc.
B1 Number of books sold is under 5 or Poor performance this week
profit made is under 5

B2 Number of books sold is over 20; profit Sales and profit are excellent this week
made is at least 20

B3 Number of books sold is at least 5; profit Sales and profit are good this week
made is at least 10

B4 All other inputs Alert manager (4)


Code example
Python
Question mp Answer Additional Guidance Mark
3 (a) A1 Get plaintext and store in plaintext variable Accept alternative wording (1)
A2 Get key and store in key variable Line numbers may be different compared to the (1)
A3 Validate key (must repeat until a valid key has been input) examples shown (1)
A4 Open file to write/append (1)
A5 Write cipher text When testing the completed code use lowercase (1)
A6 Close file for the input (1)
A7 Displays ciphertext (1)
A8 Executing and producing correct output to file and screen (must
have A3) (1)
Code examples
Python
Question mp Answer Additional Guidance Mark
4 (a) A1 At least 1 variable has a meaningful name Ignore spelling mistakes in input message
A2 Product name requested using a suitable input message
A3 Random number generated that would be at least 10 or no
higher than 30
A4 Random number generated that would be in the correct range
10 to 30
A5 First 3 letters of product name generated
A6 First 3 letters of product name and random number
concatenated to generate productCode
A7 productCode and productName output in the same print
statement (7)
Code examples
Python
For Q5, the first 11 marks are for coding that matches requirements of task. The remaining 9 marks should be allocated on a best fit.

Question mp Answer Additional Guidance Mark


5 addPlayerName()
A1 Suitable prompt for player name and assigned to suitable variable
guessCapital()
A2 Ensure question can only be used once Do not award if more than one
A3 Question includes suitable message and country name question variable e.g. question1,
A4 Check made to see if guess is correct question2 etc.
A5 If guess correct score incremented
A6 If guess is incorrect suitable message displayed
A7 If guess incorrect capital concatenated with message
A8 Repeated for a minimum of five questions Do not award if questions are asked
manually e.g. question1, question2,
repeated code for each question etc.

Do not award if 5 unique questions


are not asked while the program is
running
Main Program
A9 Player name or score displayed Do not award if the return value
from at least one function is not
used
A10 At least one menuChoice calls correct subprogram
A11 Main program calls the two sub-programs correctly (11)
Band 1 (1-3 marks) Band 2 (4-6 marks) Band 3 (7-9 marks) Mark
Little attempt to decompose into component Some attempt to decompose into component The problem has been decomposed into
parts parts component parts
Some parts of the logic are clear and Most parts of the logic are clear and mostly The logic is clear and appropriate to the
appropriate to the problem appropriate to the problem problem
Some appropriate use and manipulation of The use and manipulation of data types, The use and manipulation of data types,
data types, variables, data structures and variables and data structures and program variables and data structures and program
program constructs constructs is mostly appropriate constructs is appropriate
Parts of the code are clear and readable Code is mostly clear and readable Code is clear and readable
Finished program will not be flexible enough Finished program will function with some but Finished program could be used with other
with other data sets or input not all other data sets or input data sets or input
The program meets some of the given The program meets most of the given The program fully meets the given
requirements requirements requirements (9)
Code examples
Python Add player name function

Main program
Guess capital city function
Pearson Education Limited. Registered company number 872828
with its registered office at 80 Strand, London, WC2R 0RL, United Kingdom

You might also like