0% found this document useful (0 votes)
27 views9 pages

Computer Science: Pearson Edexcel International GCSE

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

Computer Science: Pearson Edexcel International GCSE

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

INTERNATIONAL MAKKHAYAR

Please check the examination details below before entering your candidate information

Pearson Edexcel International GCSE

Computer Science
27 – 31 March 2023 Paper Reference

Time: 2 hours 30 minutes 4CP0/02

You must have:


A computer workstation with an appropriate programming 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.
• Fill in the boxes at the top of this page with your name.
• 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 CODES folder in your user area includes all the code and data files you need.
• The invigilator 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.
Page 1 of 9
INTERNATIONAL MAKKHAYAR

Answer all questions.


Answer the questions requiring a written answer in the spaces provided.
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 .

1. Binary numbers are used to represent data in programs.


(a) Complete the table by adding these two positive 8-bit binary integers.

(2)

0 1 1 1 0 0 1 0

0 0 1 0 0 0 1 1

(b) Convert the 8-bit binary 01101110 to hexadecimal.

(2)
………………………………………………………………………………

………………………………………………………………………………

(c) Convert the hexadecimal number C4 to 8-bit binary.

(2)
………………………………………………………………………………

………………………………………………………………………………

(d) Write an arithmetic expression to show that 256 different numbers can be represented in 8
bits.
(2)
………………………………………………………………………………

………………………………………………………………………………

Page 2 of 9
INTERNATIONAL MAKKHAYAR

2. Manuel is working on logic for an exclusive OR operator, often known as XOR. This logical
operator can be implemented using AND, OR, and NOT.
(6)
(a) Complete this truth table to show Q.

A B R = A OR B S = NOT(A AND B) Q = R AND S

0 0

0 1

1 0

1 1

(b) In Shaneela’s program, the days of the week are numbered 1 for Monday, 2 for Tuesday, 3
for Wednesday, 4 for Thursday, 5 for Friday, 6 for Saturday and 7 for Sunday.
She is writing code to determine if a numerical value represents a weekday or weekendday.
Complete the following pseudocode to show the logical operations required to produce the
correct output.
(5)

Page 3 of 9
INTERNATIONAL MAKKHAYAR

3. Ships carry cargo around the world in containers. Containers come in two sizes.
Figure 1 shows an algorithm written using flowchart symbols.

Figure 1

Complete the table to show the output for each cargo item.

(6)
Cargo Item
Output
Width Length Height
4 4 2
2 2 2
3 8 5

Page 4 of 9
INTERNATIONAL MAKKHAYAR

4.(a) Denary numbers use base 10 Identify the base for hexadecimal numbers.
(1)
A. 32
B. 16
C. 8
D. 2

(b) 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

(c) Ask the user to enter the length and width of a rectangle. Your program should calculate
the area of the rectangle (length × width) and display the result with a suitable message.
Open Q04c in the code editor.
Save your amended code as Q04cFINISHED with the correct file extension for the
programming language.
(6)

5. 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

Page 5 of 9
INTERNATIONAL MAKKHAYAR

(b) Open Q05b in the code editor.


The program should print out a counter and the counter with 7 added to it.
There are six errors in the code.
Amend the code to correct the errors.
Save your amended code as Q05bFINISHED with the correct file extension for the
programming language.
(6)

(c) 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 Q05c 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 Bonus is 10% of salary
assistant has sold at least 10 pairs of shoes,
Shop income is £2000 or more and sales Bonus is 5% of salary
assistant has sold at least 5 pairs of shoes,

Do not add any further functionality.


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

(d) Give one reason why computer programmers should use comments in their
programs.
(2)
.............................................................................................................................

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

Page 6 of 9
INTERNATIONAL MAKKHAYAR

6. Computer programs use several different programming constructs.


(a) Identify the most appropriate data type for the value true
(1)
A Boolean
B Character
C Real
D String

(b) For the following statements, think through the code and write down the exact output
produced. Pay attention to:
■ whether the answer should be written as an integer or float number
■ when the numbers stored in variables are updated.

(3)
numberOne = 5
numberTwo = numberOne * 2
numberThree = numberOne + numberTwo + numberTwo
print(numberOne,numberTwo,numberThree)

_________________________________________________

_________________________________________________

7.(a) Ask the user to enter the base and height of the two triangles. Your program should
calculate the area of two triangles. Once both areas have been calculated your program should
decide which triangle has the larger area and display a suitable message.
Open Q07a in the code editor.
Save your amended code as Q07aFINISHED with the correct file extension for the
programming language.
(18)

Page 7 of 9
INTERNATIONAL MAKKHAYAR

(b) In the following question you will be asked to predict the output from each small program
using a variety of different inputs.
(6)
temp = int(input("Please enter a temperature"))
if temp >= -273 and temp <= 42:
print("Solid")
elif temp >43 and temp < 87:
print("Liquid")
else:
print("Gas")

(i) User input is 35

Output _____________________

(ii) User input is 87

Output______________________

(iii) User input is 60

Output______________________

(c) Draw a flow chart to read temperature in Fahrenheit and display a suitable message
according to the temperature state below:

Temp < 0 then ICE

Temp 0-100 then WATER

Temp >100 then STREAM

(5)

Page 8 of 9
INTERNATIONAL MAKKHAYAR

Page 9 of 9

You might also like