PMT
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 1hours
hour only
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. 100
• 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
*P72538A0120*
P72538A
©2022 Pearson Education Ltd.
Q:1/1/1/
2
1 A range check is used to check that a value input is above 10 and below 20.
Tick () one box to show which value would be accepted.
A 10
B 15
C 20
D 30
[1]
2 Four programming concepts and four descriptions are shown.
Draw one line to connect each programming concept to the most appropriate description.
Programming concept Description
A subroutine that may not
Library routine
return a value.
A standard subroutine that is
Structure diagram
available for immediate use.
A subroutine that can be used
Procedure
in an assignment statement.
An overview of a program
Function
or subroutine.
[3]
© Cambridge University Press & Assessment 2023 2210/02B/SP/23
3
3 A program checks if the weight of a baby is at least 2 kilograms.
Give, with reasons, two different values of test data that could be used for the baby’s weight.
Each reason must be different.
Value 1 ..............................................................................................................................................
Reason ..............................................................................................................................................
...........................................................................................................................................................
Value 2 ..............................................................................................................................................
Reason ..............................................................................................................................................
...........................................................................................................................................................
[4]
4 (a) Circle
Write the two
a python actions
code that
to get a programofneeds
username a usertoand
takeoutput
to storethe
data in a file.
string traversal output.
activate calculate close open output
print read search sort write
[2]
(b) A program halted unexpectedly with the error message ‘File not found’ whilst trying to
read data from a file.
Outline the actions that the program needs to take to prevent this error occurring.
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
............................................................................................................................................... [2]
[5]
© Cambridge University Press & Assessment 2023 2210/02B/SP/23 [Turn over
4
5 (a) Draw a flowchart for an algorithm to:
• allow numbers to be input
• ignore any numbers that are negative
• count how many numbers are positive
• output the count of positive numbers when zero is input and end the algorithm.
[6]
© Cambridge University Press & Assessment 2023 2210/02B/SP/23
5
(b) Explain the changes you will make to your algorithm to also count the negative numbers.
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
............................................................................................................................................... [2]
6 This section of program code asks for 80 numbers between 100 and 1000 inclusive to be entered.
The pseudocode checks that the numbers are in the correct range and then stores the valid
numbers in an array. It counts how many of the numbers are larger than 500 and then outputs the
result when finished.
1 Count = 0
01 Count ← 0 2 FOR Index = 1 TO 80
3 SEND "Enter a number between 100 and 1000"
02 FOR Index ← 1 TO
4
80 RECEIVE Number FROM KEYBOARD
03 INPUT "Enter
5 a number between
WHILE Number <= 99100 and 1000
AND Number ", Number
>= 1001
04 WHILE Number
6 <= 99 SEND AND
"ThisNumber
is incorrect.>= 1001
Please Try
05 INPUT "This is incorrect,
7 again." RECEIVEplease try again", Number
Number FROM
06 ENDWHILE 8 KEYBOARD
9 ENDWHILE
07 Num[80] ← Number
10 Num[80] = Number
08 IF Number >11500 THEN Count
IF Number > 500 ←THEN Count + 1 ENDIF
09 UNTIL Index = 80
12 Count = Count + 1
10 PRINT Index 13 ENDIF
11 PRINT "numbers 14 UNTIL
were index = 80
larger than 500"
15 SEND Index TO DISPLAY
RECEIVE "Numbers were larger than 500"
There are four lines of code that contain errors.
State the line number for each error and write the correct code for that line.
Error 1 Line Number ....................
Correct Code .....................................................................................................................................
Error 2 Line Number ....................
Correct Code .....................................................................................................................................
Error 3 Line Number ....................
Correct Code .....................................................................................................................................
Error 4 Line Number ....................
Correct Code .....................................................................................................................................
[4]
© Cambridge University Press & Assessment 2023 2210/02B/SP/23 [Turn over
12
912
7 (a) Rewrite this pseudocode algorithm using a WHILE … DO … ENDWHILE loop.
B ← FALSE
INPUT Num
RECEIVE Num FROM KEYBOARD
FOR Counter ← 1 TO 12
IF A[Counter] = Num
THEN
B ← TRUE
ENDIF
NEXT Counter
END FOR
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
............................................................................................................................................... [4]
(b) Identify the purpose of the algorithm in (a).
....................................................................................................................................................
............................................................................................................................................... [1]
(c) Explain the difference between a WHILE … DO … ENDWHILE and a REPEAT … UNTIL loop.
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
............................................................................................................................................... [3]
© Cambridge University Press & Assessment 2023 2210/02B/SP/23