Paper 1 Computer Science QS
Paper 1 Computer Science QS
Surname
Other Names
Centre Number
Candidate Number
Candidate Signature
I declare this is my own work.
GCSE
COMPUTER SCIENCE
Paper 1 Computational thinking and programming
skills – Python
8525/1B
[Turn over]
*JUN2285251b01*
2
INSTRUCTIONS
*02*
3
INFORMATION
ADVICE
CORRECT METHOD
WRONG METHODS
*03*
4
0 1
An algorithm, that uses the modulus operator, has been
represented using pseudo-code in FIGURE 1, provided
on page 2 of the insert.
For example:
• 14 MOD 3 evaluates to 2
• 24 MOD 5 evaluates to 4
*04*
5
0 1 . 1
Shade ONE lozenge that shows the line number where
selection is FIRST used in the algorithm in FIGURE 1.
[1 mark]
A Line number 1
B Line number 2
C Line number 3
D Line number 4
[Turn over]
*05*
6
0 1 . 2
Shade ONE lozenge that shows the output from the
algorithm in FIGURE 1 when the user input is 4
[1 mark]
A 0
B 2
C 4
D 8
E 16
*06*
7
0 1 . 3
Shade ONE lozenge that shows the line number where
assignment is FIRST used in the algorithm in
FIGURE 1. [1 mark]
A Line number 1
B Line number 2
C Line number 3
D Line number 4
[Turn over]
*07*
8
0 1 . 4
Shade ONE lozenge that shows the line number that
contains a relational operator in the algorithm in
FIGURE 1. [1 mark]
A Line number 1
B Line number 2
C Line number 3
D Line number 4
*08*
9
0 1 . 5
Shade ONE lozenge to show which of the following is a
TRUE statement about the algorithm in FIGURE 1,
provided on page 2 of the insert. [1 mark]
[Turn over]
*09*
*10*
0 1 . 6
• Line numbers are included but are not part of the program.
The program in FIGURE 2 needs to be changed so that it repeats five times using
DEFINITE (count controlled) iteration.
Shade ONE lozenge, on pages 10 to 12, next to the program that does this
correctly. [1 mark]
10
A for x in range(0, 5):
i = int(input("Enter a number: "))
if i % 2 == 0:
print(i * i)
else:
print(i)
*11*
C x = 1
while x != 6:
11
i = int(input("Enter a number: "))
if i % 2 == 0:
print(i * i)
else:
print(i)
x = x + 1
[Turn over]
*12*
D x = 6
while x != 0:
i = int(input("Enter a number: "))
if i % 2 == 0:
print(i * i)
else:
print(i)
x = x – 1
12
6
BLANK PAGE
*13*
[Turn over]
13
14
0 2
FIGURE 3, provided on pages 4 and 5 of the insert,
shows an algorithm, represented using pseudo-code,
that calculates the delivery cost for an order from a
takeaway company.
0 2 . 1
Using FIGURE 3, complete the table. [2 marks]
55.5 2
35.0 5
0 2 . 2
State how many possible values the result of the
comparison deliveryDistance ≤ 5 could have in
the algorithm shown in FIGURE 3. [1 mark]
*14*
15
0 2 . 3
State the most suitable data type for the following
variables used in FIGURE 3. [2 marks]
deliveryCost
messageOne
0 2 . 4
State ONE other common data type that you have NOT
given in your answer to Question 02.3. [1 mark]
[Turn over]
*15*
16
0 3
FIGURE 4, provided on page 6 of the insert, shows a
Python program that calculates car park charges.
0 3 . 1
Rewrite LINE 4 in FIGURE 4 to CONCATENATE the car
registration with the string " is not valid", and
store the result in the variable displayMessage.
*16*
17
0 3 . 2
The charge for parking for two or more hours is
changed to include an additional £2 fee.
[Turn over]
8
*17*
18
0 4
The two Python programs in FIGURE 5, provided on
pages 8 and 9 of the insert, output the value that is
equivalent to adding together the integers between 1
and an integer entered by the user.
0 4 . 1
Shade ONE lozenge to indicate which of the statements
is true about the programs in FIGURE 5. [1 mark]
*18*
19
0 4 . 2
Justify your answer for Question 04.1. [2 marks]
[Turn over]
*19*
20
0 5
A programmer has started to write a program using
Python. Their program is shown in FIGURE 6, provided
on page 10 of the insert.
*20*
21
0 5 . 1
The program shown in FIGURE 6 contains a syntax
error.
[Turn over]
*21*
22
0 5 . 2
The program shown in FIGURE 6 also contains a logic
error.
Line number
Corrected line
0 5 . 3
*22*
23
0 6
A program is being developed that allows users to rate
and review movies. A user will enter their rating (out of
10) and a written review for each movie they have
watched.
0 6 . 1
Define the term ABSTRACTION. [1 mark]
[Turn over]
*23*
24
0 6 . 2
A user will be able to register, log in and log out of the
program. When registering, a new user will enter their
details, before confirming their email address.
*24*
25
BLANK PAGE
[Turn over]
*25*
26
0 7
Write a Python program to check if an email address
has been entered correctly by a user.
*26*
27
[Turn over]
*27*
28
*28*
29
[Turn over]
*29*
30
*30*
31
[Turn over] 8
*31*
32
0 8
Write a Python program that calculates the value of a
bonus payment for an employee based on how many
items they have sold and the number of years they have
been employed.
*32*
33
[Turn over]
*33*
34
*34*
35
[Turn over]
*35*
36
*36*
37
[Turn over]
*37*
38
0 9
FIGURE 8, provided on page 13 of the insert, shows an
algorithm represented using pseudo-code.
*38*
39
0 9 . 1
Shade ONE lozenge which shows the output of LINE 4
from the algorithm shown in FIGURE 8. [1 mark]
A F
B Freddie
C Lily
D S
E Sarah
[Turn over]
*39*
40
0 9 . 2
Shade ONE lozenge which shows the output of LINE 5
from the algorithm shown in FIGURE 8. [1 mark]
A 1
B 2
C 4
D 5
E 10
0 9 . 3
State the output of LINE 7 from the algorithm shown in
FIGURE 8. [1 mark]
*40*
41
0 9 . 4
Two extra lines are being added to the end of the
algorithm in FIGURE 8.
Fill in the gaps so the output from the new final line will
be the string 'Thomasrah'. [2 marks]
[Turn over]
12
*41*
42
1 0
1 0 . 1
You may not need to use all the rows in the table.
[4 marks]
*42*
43
n a b OUTPUT
50
[Turn over]
*43*
44
1 0 . 2
State the value that will be output for the subroutine
call calculate(1) [1 mark]
1 0 . 3
*44*
45
BLANK PAGE
[Turn over]
*45*
46
1 0 . 4
A REPEAT…UNTIL iteration structure was used in
FIGURE 9.
*46*
47
[Turn over] 8
*47*
*48*
1 1 . 1
The algorithm in FIGURE 12, represented using pseudo-code, should output the
size of a sound file in BYTES that has been sampled 100 times per second, with a
sample resolution of 16 bits and a recording length of 60 seconds.
48
A subroutine called getSize has been developed as part of the algorithm.
On the opposite page, complete FIGURE 12 by filling in the gaps using the items in
FIGURE 11, provided on page 16 of the insert.
You will not need to use all the items in FIGURE 11. [6 marks]
FIGURE 12
*49*
size
size
49
ENDSUBROUTINE
[Turn over]
50
1 1 . 2
A local variable called size has been used in
getSize.
*50*
51
1 1 . 3
State THREE advantages of using subroutines.
[3 marks]
[Turn over] 10
*51*
52
1 2
FIGURE 13, provided on page 17 of the insert, shows an
algorithm represented in pseudo-code. A developer
wants to check the algorithm works correctly.
1 2 . 1
On the opposite page, complete the trace table for the
algorithm shown in FIGURE 13.
*52*
53
arr
i j temp
[0] [1] [2]
c b a
[Turn over]
*53*
54
1 2 . 2
State the purpose of the algorithm. [1 mark]
*54*
55
1 2 . 3
FOR i 0 TO 2
FOR j 0 TO 2
Explain why the algorithm did not work when the value
2 was used instead of the value 1 on these two lines.
[1 mark]
[Turn over]
8
*55*
56
1 3
A program is being developed in Python to simulate a
card game.
1 3 . 1
FIGURE 14 shows part of the program that will get a
player to enter the position of a card to swap.
FIGURE 14
*56*
57
[Turn over]
*57*
58
1 3 . 2
There are 500 cards within the game in total. Each
card is numbered from 1 to 250 and each number
appears twice in the whole set of cards.
A valid run:
• consists of five cards
• can start from any position in the player’s
100 cards
• the second card’s value is one more than the first
card’s value, the third card’s value is one more
than the second card’s value, the fourth card’s
value is one more than the third card’s value, and
the fifth card’s value is one more than the fourth
card’s value.
*58*
59
[Turn over]
*59*
60
*60*
61
[Turn over]
*61*
62
*62*
63
[Turn over]
*63*
64
10
*64*
65
BLANK PAGE
[Turn over]
*65*
1 4
*66*
At the beginning of the game a bingo ticket is generated with nine different key
terms from computer science in a 3 x 3 grid. An example bingo ticket is provided
in FIGURE 15, provided on page 18 of the insert.
If an answer matches a key term on the player’s bingo ticket, then the key term will
66
be marked off automatically.
BLANK PAGE
*67*
[Turn over]
67
1 4 . 1
*68*
Complete the Python program in FIGURE 16, on the opposite page, by filling in the
68
five gaps.
• Line numbers are included but are not part of the program.
[4 marks]
FIGURE 16
*69*
1 ticket = [["","",""],
["","",""],
["","",""]]
2 i = 0
3 while i < 3:
69
4 j =
5 while j < 3:
6 ticket[ ][ ] = generateKeyTerm()
8
[Turn over]
70
1 4 . 2
Each time a player answers a question correctly the
ticket array is updated; if their answer is in the
ticket array then it is replaced with an
asterisk (*).
An example of the ticket array containing key
terms and asterisks is shown in FIGURE 17,
provided on page 19 of the insert.
Write a subroutine in Python called checkWinner
that will count the number of asterisks.
The subroutine should:
• take the ticket array as a parameter
• count the number of asterisks in the ticket
array
• output the word Bingo if there are nine asterisks
in the array
• output the total number of asterisks if there are
fewer than nine asterisks in the array.
You MUST write your own count routine and not use
any built-in count function that might be available in
Python.
You SHOULD use indentation as appropriate,
meaningful variable name(s) and Python syntax in
your answer.
The answer grid, on pages 71 to 73, contains vertical
lines to help you indent your code. [8 marks]
*70*
71
[Turn over]
*71*
72
*72*
73
END OF QUESTIONS 12
*73*
74
*74*
75
*75*
76
BLANK PAGE
Question Mark
1
2–3
4–5
6–7
8–9
10
11
12
13
14
TOTAL
Copyright information
For confidentiality purposes, all acknowledgements of third-party copyright material are published
in a separate booklet. This booklet is published after each live examination series and is
available for free download from www.aqa.org.uk.
Permission to reproduce all copyright material has been applied for. In some cases, efforts to
contact copyright-holders may have been unsuccessful and AQA will be happy to rectify any
omissions of acknowledgements. If you have any queries please contact the Copyright Team.
IB/M/TT/Jun22/8525/1B/E4
*76* *226G8525/1B*