0% found this document useful (0 votes)
14 views13 pages

Edexcel Computer Science Mock Exam 2024

Uploaded by

viwaindisa
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)
14 views13 pages

Edexcel Computer Science Mock Exam 2024

Uploaded by

viwaindisa
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

Mock Exam 1 – October 2024

Edexcel Grade 1-9 Computer Science


Duration: 2 hours
Answer All Questions.
Section A - Multiple Choice Questions (1*10 = 10 Marks)

1. Which of the following is a characteristic of an algorithm?


A) Inconsistency
B) Precision
C) Ambiguity
g
D) Randomness

2. Which of the following operators is used for exponentiation in Python?


A) + (Addition]
B) ** C Power)
C) * (Multiplication]
Division)
D) // CEntegar
3. In a flowchart, what shape represents a decision?
A) Rectangle
B) Oval
C) Diamond O
D) Circle

4. What will the output be for the following Python code?

Dilini Gunawardane
A) High
B) Low O
C) Error
D) Nothing
5. What is the result of the binary addition 11012+1012?
A) 10102
B) 100102 & P
d
C) 110102
D) 11102

6. Which data type is suitable to store a decimal value in Python?


A) int
B) float
C) str O
D) bool

7. What is the purpose of a logical operator in programming?


A) To perform addition and subtraction Arithmetic operators
B) To compare values Logical Operators
C) To store multiple values
D) To display values

8. Which symbol is used to represent comments in Python?


A) //
B) #
C) *
O
D) !

Dilini Gunawardane
9. What would the output of this Python code be?

A) 17
O
B) 13 5
345 + 3 -

C) 10
D) 8 15 + (2)

10. Which number system uses only 0s and 1s?


A) Decimal
B) Hexadecimal
C) Binary O
D) Octal

Section B: Short Answer Questions (30 Marks)


1. (a) Convert the binary number 11001012 to denary. (02 Marks)

2 2 223z2 20
G I I 0010
6432 G 040 I

4+1
(4+ 32
10189
+ =
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
…………………………………………………………………………………………………….. O
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Dilini Gunawardane
(b) Convert the denary number 57 to binary. (02 Marks)

2) 225 2
+
22222
128 843216 8 42 ↓
O G I ( I 00 ↓

……………………………………………………………………………………………………..
001110012
……………………………………………………………………………………………………..
…………………………………………………………………………………………………….. ②
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

2. Given the pseudocode below, identify and correct the error: (02 Marks)
SET sum TO 0
FOR count FROM 1 TO 5 DO
SET sum TO sum + count
iterates the count value
so

SET count TO count + 1 # for loop already


to write another loop
problematic
.

it will
END FOR
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
SET sum TO O
……………………………………………………………………………………………………..
FOR count FROM ITOS DO The for iterates the count value
…………………………………………………………………………………………………….. loop
SET sum to sum + count
……………………………………………………………………………………………………..
END FOR
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Dilini Gunawardane
3. Define data and explain why computers use binary to represent data. (02 Marks)

Data is raw facts that have no specific


……………………………………………………………………………………………………..meaning
because it
aligns with on loff
Computers binary
……………………………………………………………………………………………………..
use

states of electronic circuits which helps to store and


……………………………………………………………………………………………………..
data
efficiently
……………………………………………………………………………………………………..
process
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

4. List and explain two advantages of using flowcharts in problem-solving. (02 Marks)

program flows
It is to see how a
……………………………………………………………………………………………………..
easy
flowcharts follow an international standard it is
…………………………………………………………………………………………………….. for
easy
-

flowchart user to and understand


pick
……………………………………………………………………………………………………..
any up a diagram
.
……………………………………………………………………………………………………..
it

……………………………………………………………………………………………………..

5. Describe the importance of initializing variables in programming. (02 Marks)

Varrable initialization ensures hold known


…………………………………………………………………………………………………….. they
values and undefined behavior
preventing
……………………………………………………………………………………………………..
errors

programs
in
……………………………………………………………………………………………………..
.

……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Dilini Gunawardane
6. What is an overflow error, and how does it occur in binary addition? (02 Marks)

When the binary number exceeds more than


…………………………………………………………………………………………………….. 8 bits

……………………………………………………………………………………………………..
Whenthe calculation of the number
…………………………………………………………………………………………………….. binary
exceeds more than 8 bits
…………………………………………………………………………………………………….. .

……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
O
7. What are the benefits of using meaningful variable names? Explain with an example.
(03 Marks)

to understand the pseudocode more


…………………………………………………………………………………………………….. and what it has
Easy
to be done
……………………………………………………………………………………………………..
.

……………………………………………………………………………………………………..
egSET aug To maths science +art + 14
…………………………………………………………………………………………………….. History
……………………………………………………………………………………………………..
Instead of a as a name for
……………………………………………………………………………………………………..
using we can
average
to
clearly represent
the variable .
……………………………………………………………………………………………………..
use
any
…………………………………………………………………………………………………….. ②
8. Convert the hexadecimal number A3 to binary and denary. (04 Marks)

A 3
……………………………………………………………………………………………………..
2 220
……………………………………………………………………………………………………..
8 42/8421 > 18 + 3
134
…………………………………………………………………………………………………….. =
-

1010 00 11
……………………………………………………………………………………………………..
1010001l2
……………………………………………………………………………………………………..
,
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Dilini Gunawardane
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

9. Calculate the two's complement representation of -34 in an 8-bit binary format. (03 Marks)

2) 26 223222
125 64 32 16 842
O O I g 001 g
I ↓ G I I I O I

I I G I 11 I g
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
…………………………………………………………………………………………………….. ②
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

[Link] the role of the control structures 'sequence,' 'selection,' and 'iteration' in algorithms.
(06 Marks)

Sequance is the order in which instructions are executed


……………………………………………………………………………………………………..
condition
Selection depends on a certain while repitition
……………………………………………………………………………………………………..
and
thing
repeating something multiple times .
……………………………………………………………………………………………………..
is

……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Dilini Gunawardane
Section C: Practical and Application Questions (20 Marks)
1. The following Python code intends to print the first five even numbers. Identify and correct
any errors. (04 Marks)

num 1
……………………………………………………………………………………………………..
=

While num <-10 :


……………………………………………………………………………………………………..
if num 2 0 :
……………………………………………………………………………………………………..
= =

print (num)
……………………………………………………………………………………………………..
numt 1
……………………………………………………………………………………………………..
=

……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

2. The following pseudocode is written to calculate the average of five numbers entered by
the user.

SET sum TO 0
FOR i FROM 1 TO 5
SEND "Enter number" TO DISPLAY
RECEIVE number FROM KEYBOARD
SET sum TO sum + number
END FOR
SET average TO sum / 5
SEND average TO DISPLAY

Dilini Gunawardane
(a) Draw a flow chart for the above pseudocode. (06 Marks)

Start

-
.

Sum = O

i
h
from I
i ①
to 5

Input number

Sum-sumt number

i
ii
average-sum/5


Dilini Gunawardane
Outputaverage < Stop
(b) Implement this algorithm in the high-level language you are studying. (10 Marks)

Sum O
……………………………………………………………………………………………………..
=

for i in (1 6) :
……………………………………………………………………………………………………..
range ,

number - rut (input ("Enter number"))


……………………………………………………………………………………………………..
sum-sum-number
……………………………………………………………………………………………………..
sum/5
……………………………………………………………………………………………………..
average
-

print (average)
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Additional Questions: Scenario Based (40 Marks)


1. Online Shopping System (15 Marks)
An online shopping system allows users to add items to their cart and proceed to checkout. The
system calculates the total price and applies a discount if the total price exceeds a certain
amount.
(a) Draw a flowchart to represent the process of adding items to the cart and checking out.
(05 Marks)

Dilini Gunawardane
Start


Input items

Output amount


p

(b) Write pseudocode for the checkout process, including the calculation of the total price
and the application of a discount. (05 Marks)

SEND"Enter items " TO DISPLAY


……………………………………………………………………………………………………..
RECEIVE ITEMS FROM CINTE GARS KEYBOARD
……………………………………………………………………………………………………..
#f amount 25000 THEN
……………………………………………………………………………………………………..
-

S amountTo amount 0 5
*
…………………………………………………………………………………………………….. .

ENDF
……………………………………………………………………………………………………..
SEND"This is amount "Samount TO DISPLAY
……………………………………………………………………………………………………..
your
-

……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Dilini Gunawardane
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

(c) Identify the variables, constants, and their data types used in your pseudocode.
(05 Marks)

mount-integar
……………………………………………………………………………………………………..
a

items-string
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

2. Student Grade Calculation (15 marks)


A school system calculates the final grade for students based on their scores on assignments,
quizzes, and exams. The final grade is a weighted average of these components.
(a) Write a Python program to calculate the final grade for a student. (10 marks)

assignment-int (input &"Enter assignment mark"))


……………………………………………………………………………………………………..
-int (input ("Enter mark"))
……………………………………………………………………………………………………..
quie quit
exam-int (input ("Enter fram mark"))
……………………………………………………………………………………………………..
ang-assignmentquie texam/3
……………………………………………………………………………………………………..
print Cavg)
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Dilini Gunawardane
(b) Explain the purpose of each variable used in your program. (05 marks)

assignment is to get their assignment mark


……………………………………………………………………………………………………..
to
get their quie marke
……………………………………………………………………………………………………..
quit is
is to get their exam marte
……………………………………………………………………………………………………..
exam

is to
get the average of all the sums .
……………………………………………………………………………………………………..
ang
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
3. Write a Python program to print even numbers from 1-40, using for loop. (10 Marks)

for num in (0 41 2)
……………………………………………………………………………………………………..
range , ,

print Snum)
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..

Dilini Gunawardane

You might also like