Computer Science · June 2025 · Question paper · Paper 1B Computational thinking and programming skills Pytho

AQA GCSE Computer Science question paper for Paper 1B Computational thinking and programming skills Pytho, June 2025 — 8525, file AQA-8525-Paper-1B-Computational-thinking-and-programming-skills-Pytho-QP-JUN25.pdf.

Advertisement
Loading the paper…
Text of this paper

Please write clearly in block capitals.
Centre number

Candidate number

Surname
Forename(s)
Candidate signature

I declare this is my own work.

GCSE
COMPUTER SCIENCE
Paper 1 Computational thinking and programming skills – Python
Monday 12 May 2025

Afternoon

Time allowed: 2 hours

Materials

For Examiner’s Use

• There are no additional materials required for this paper.
• You must not use a calculator.

Question

Instructions

1

Use black ink or black ball-point pen. Use pencil only for drawing.
Answer all questions.
You must answer the questions in the spaces provided.
If you need extra space for your answer(s), use the lined pages at the end of
this book. Write the question number against your answer(s).
• Do all rough work in this book. Cross through any work you do not want
to be marked.
• Questions that require a coded solution must be answered in Python.
• You should assume that all indexing in code starts at 0 unless stated otherwise.

8–9

Information

10

•
•
•
•

The total number of marks available for this paper is 90.

Mark

2
3
4
5
6
7

11

TOTAL

Advice

For the multiple-choice questions, completely fill in the lozenge alongside the appropriate answer.
CORRECT METHOD

WRONG METHODS

If you want to change your answer you must cross out your original answer as shown.
If you wish to return to an answer previously crossed out, ring the answer you now wish to select as
shown.

*Jun2585251B01*
IB/G/Jun25/G4003/E11

8525/1B

2
Do not write
outside the
box

Answer all questions.
0 1

Figure 1 shows a program written in Python.
• Line numbers are included but are not part of the program.
Figure 1
1
2
3
4
5
6
7
8

0 1 . 1

# Python program
a = 1
b = 1
c = 5
while b < c:
a = a + a
b = b + 1
print(a)

Where is an arithmetic operation first used in the program in Figure 1?
Shade one lozenge.

0 1 . 2

A

Line number 1

B

Line number 5

C

Line number 6

D

Line number 8

[1 mark]

Which of the following is a false statement about the program in Figure 1?
Shade one lozenge.

A

This program contains a comment.

B

This program uses assignment.

C

This program uses concatenation.

D

This program uses iteration.

*02*

[1 mark]

IB/G/Jun25/8525/1B

3
0 1 . 3

State the relational operator used in the program in Figure 1.

0 1 . 4

Complete the trace table for the program in Figure 1.

Do not write
outside the
box

[1 mark]

You may not need to use all the rows in the table.

a

b

[4 marks]

c

Output

7

Turn over for the next question

Turn over ►

*03*

IB/G/Jun25/8525/1B

4
0 2

A coffee shop has a loyalty scheme which rewards customers for buying drinks.
The customer gets one stamp on their loyalty card for each individual drink they buy.
• Every 4th stamp on the card gets the customer a free biscuit.
• Every 5th stamp on the card gets the customer a free pastry.
• When the customer reaches 20 stamps, they get a free cake (but no biscuit or
pastry).
The Python program shown in Figure 2 should display whether the customer gets a
free biscuit, pastry, cake or nothing free for their first 20 drinks.
For each drink purchased, the program must output either: "Free biscuit",
"Free pastry", "Free cake" or "Nothing free".
Some parts of the program have been replaced with the labels

to

.

Figure 2

i = 1
while i <= 20:
if i % 20 == 0:
print("Free cake")
elif
:
print("Free pastry")
elif i % 4 == 0:
else:
i = i + 1
0 2 . 1

State the Python code that should be written in place of the labels in the program
written in Figure 2.
[3 marks]

*04*

IB/G/Jun25/8525/1B

Do not write
outside the
box

5
0 2 . 2

The coffee shop wants to work out the total value of the free biscuits, pastries and
cakes given out each day.

Do not write
outside the
box

• Each free biscuit is worth £1
• Each free pastry is worth £2.50
• Each free cake is worth £3
Write a Python program to get the number of free biscuits, pastries and cakes, and
calculate the total value for the day.
Your program must:
• get the user to enter the number of free biscuits and store it in a variable
• get the user to enter the number of free pastries and store it in a variable
• get the user to enter the number of free cakes and store it in a variable
• calculate the total value of the free items
• output the total value of the free items.
You should use indentation as appropriate, meaningful variable name(s) and Python
syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.

[4 marks]

7

Turn over ►

*05*

IB/G/Jun25/8525/1B

6
0 3

Write a Python program that calculates the total cost of a netball coaching session for
a group of students.
The total cost is calculated as follows:
• A booking fee of £20 plus:
o £5 per student if there are 15 students or fewer
o £3 per student if there are more than 15 students
• If there are more than 25 students, a booking fee of £100 and no other charges.
Your program should:
• get the user to enter the number of students
• output the total cost of the session.
You should use indentation as appropriate, meaningful variable name(s) and Python
syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.

*06*

[8 marks]

IB/G/Jun25/8525/1B

Do not write
outside the
box

7
Do not write
outside the
box

8

Turn over ►

*07*

IB/G/Jun25/8525/1B

8
0 4

A programmer is developing a system to register users for an app. The program
needs to validate the first name of the user.

0 4 . 1

Identify the purpose of validation.
Shade one lozenge.

0 4 . 2

A

Checks that the user is human

B

Checks that the user is who they say they are

C

Checks that the input is a name

D

Checks that the input is reasonable

[1 mark]

Write a Python program to check the user’s first name.
Your program should:
• get the user’s first name
• check that the first name has more than one character and fewer than 15
characters:
o if it has, output the message Name accepted
o if it has not, output the message Name not accepted
• repeat until the name entered has a specified length.
You should use indentation as appropriate, meaningful variable name(s) and Python
syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.

*08*

[6 marks]

IB/G/Jun25/8525/1B

Do not write
outside the
box

9
Do not write
outside the
box

Question 4 continues on the next page

Turn over ►

*09*

IB/G/Jun25/8525/1B

10
0 4 . 3

Do not write
outside the
box

Which of the following statements best describes boundary test data?
Shade one lozenge.

0 4 . 4

[1 mark]

A

Data that is not of the allowed data type

B

Data that is at the limits of the allowed range

C

Data that is expected by the program

D

Data that will cause a syntax error

The programmer has started planning the tests that will be used to check the program
is working correctly.
The program should:
• check that the first name has more than one character and fewer than 15
characters:
o if it has, then output the message Name accepted
o if it has not, then output the message Name not accepted
The start of the test plan is shown in Figure 3.
Figure 3
Test
number

Test data

Type of
test data

Expected result

1

Thomas

Normal

Name accepted

Boundary

Name not accepted

2

State the number of characters that a string used for test number 2 in Figure 3 could
contain.
[1 mark]

0 4 . 5

Normal and boundary are two types of test data.
State one type of test data that has not been used in Figure 3.

*10*

[1 mark]

IB/G/Jun25/8525/1B

11
Do not write
outside the
box

Question 4 continues on the next page

DO NOT WRITE ON THIS PAGE
ANSWER IN THE SPACES PROVIDED

Turn over ►

*11*

IB/G/Jun25/8525/1B

12
0 4 . 6

Do not write
outside the
box

A programmer is designing an algorithm to generate usernames for users.
The algorithm should:
• ask the user to input their first name and their last name
• create a username:
o if their first name has more than three characters, their username will consist of
the first three characters of their first name followed by their last name
o if their first name has three or fewer characters, their username will consist of
their full first name followed by their last name
• output the username.
Figure 4 contains the statements required to implement a version of this algorithm.
Figure 4

firstName  USERINPUT
LEN(firstName) > 3
username  firstName + lastName
OUTPUT username
username  SUBSTRING(0, 2, firstName) + lastName
lastName  USERINPUT
Using the labels (
the algorithm.

*12*

to

) shown in Figure 4, complete the flowchart to implement
[3 marks]

IB/G/Jun25/8525/1B

13
Do not write
outside the
box

13

Turn over for the next question

Turn over ►

*13*

IB/G/Jun25/8525/1B

14
0 5

The Python program in Figure 5 gets five numbers and outputs the sum of those
numbers.
Figure 5

num1 = int(input())
num2 = int(input())
num3 = int(input())
num4 = int(input())
num5 = int(input())
total = num1 + num2 + num3 + num4 + num5
print(total)
0 5 . 1

An integer data type is used in the program in Figure 5.
Describe what is meant by a data type.

[1 mark]

The variables num1, num2, num3, num4 and num5 in Figure 5 have an
integer data type.
0 5 . 2

Explain why these variables do not have a string data type.

0 5 . 3

The program in Figure 5 needs to be changed to use numbers with a fractional part
(a real number).
State a data type in Python that should be used.

*14*

[1 mark]

[1 mark]

IB/G/Jun25/8525/1B

Do not write
outside the
box

15
0 5 . 4

Rewrite the program in Figure 5 so that it achieves the same result but uses an
iteration structure that contains only one input()statement.

Do not write
outside the
box

Your answer must be written in Python.
You should use indentation as appropriate, meaningful variable name(s) and Python
syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.

[5 marks]

8
Turn over ►

*15*

IB/G/Jun25/8525/1B

16
0 6

A series of numbers shown in Figure 6 are to be sorted into ascending order (from
smallest to largest).
Figure 6
45

0 6 . 1

23

78

55

49

A bubble sort algorithm has been developed to sort the numbers in Figure 6.
Fill in the table to show the steps involved in applying a bubble sort algorithm to sort
the numbers shown in Figure 6.
You should show the new order every time the order has changed.

*16*

[3 marks]

45

23

78

55

49

23

45

49

55

78

IB/G/Jun25/8525/1B

Do not write
outside the
box

17
0 6 . 2

A programmer decides to use a merge sort algorithm to sort the same values shown
in Figure 6.
Complete the diagram to show how the merge part of the merge sort algorithm is
applied to Figure 6.
[3 marks]

Question 6 continues on the next page

Turn over ►

*17*

IB/G/Jun25/8525/1B

Do not write
outside the
box

18
0 6 . 3

State one advantage and one disadvantage of a bubble sort compared to a merge
sort.
[2 marks]

Do not write
outside the
box

Advantage

Disadvantage

0 6 . 4

The programmer has an array of 2500 numbers, stored in ascending order (smallest
to largest).
The programmer needs to write a program to search for a value in the array.
Explain why a binary search is better than a linear search for this array.

[2 marks]

10

*18*

IB/G/Jun25/8525/1B

19
Do not write
outside the
box

Turn over for the next question

DO NOT WRITE ON THIS PAGE
ANSWER IN THE SPACES PROVIDED

Turn over ►

*19*

IB/G/Jun25/8525/1B

20
0 7

Do not write
outside the
box

Figure 7 shows a subroutine written in pseudo-code.
Figure 7

SUBROUTINE testSub(number)
OUTPUT number
x  number MOD 2
OUTPUT x
IF x = 0 THEN
RETURN True
ELSE
RETURN False
ENDIF
ENDSUBROUTINE
0 7 . 1

Describe the purpose of the subroutine in Figure 7.

0 7 . 2

The subroutine in Figure 7 is called using testSub(10)
Complete the table to show the values output.

Program Code

[1 mark]

[2 marks]
Output

OUTPUT number
OUTPUT x

0 7 . 3

The subroutine in Figure 7 is called using testSub(8)
State the value returned.

*20*

[1 mark]

IB/G/Jun25/8525/1B

21
0 7 . 4

State the identifier for the parameter in Figure 7.

0 7 . 5

State two characteristics of the structured approach to programming.

Do not write
outside the
box

[1 mark]

[2 marks]

1

2
7

Turn over for the next question

Turn over ►

*21*

IB/G/Jun25/8525/1B

22
0 8

Do not write
outside the
box

Figure 8 shows an algorithm represented using pseudo-code.
• Line numbers are included but are not part of the algorithm.
Figure 8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

0 8 . 1

b1  '0010'
b2  '0111'
new  ''
FOR i  0 TO LEN(b1) - 1
IF b1[i] = '1' OR b2[i] = '1' THEN
IF NOT (b1[i] = '1' AND b2[i] = '1') THEN
new  new + '1'
ELSE
new  new + '0'
ENDIF
ELSE
new  new + '0'
ENDIF
ENDFOR
OUTPUT new

Complete the trace table for the algorithm shown in Figure 8.
You may not need to use all the rows in the table.

b1

*22*

b2

new

[5 marks]

i

IB/G/Jun25/8525/1B

23
0 8 . 2

Explain why line 4 in Figure 8 uses LEN(b1) - 1 instead of LEN(b1)

Do not write
outside the
box

[1 mark]

Turn over for the next question

Turn over ►

*23*

IB/G/Jun25/8525/1B

24
0 9

Do not write
outside the
box

Figure 9 shows five algorithms, represented using pseudo-code.
Figure 9

*24*

A

numbers  [44, 1, 2, 14, 68]
counter  0
total  0
WHILE counter < 5
index  counter
total  total + numbers[index]
counter  counter + 1
ENDWHILE
OUTPUT total

B

numbers  [44, 1, 2, 14, 68]
total  0
FOR a  0 TO LEN(numbers) - 1
total  total + numbers[a]
ENDFOR
OUTPUT total

C

numbers  [44, 1, 2, 14, 68]
total  0
FOR a  1 TO 7
total  total + numbers[a]
ENDFOR
OUTPUT total

D

numbers  [44, 1, 2, 14, 68]
total  0
WHILE total > 0
total  total + numbers[total]
ENDWHILE
OUTPUT total

E

numbers  [44, 1, 2, 14, 68]
total  0
x  1
REPEAT
total  total + numbers[x]
UNTIL x = 5
OUTPUT total

IB/G/Jun25/8525/1B

25
The algorithms in Figure 9 have been written to calculate the total of the five values
in the array numbers. Not all of the algorithms work.
Complete the table by ticking () one box in each column (A–E).

Do not write
outside the
box

[2 marks]

Algorithm
A

B

C

D

E

Algorithm totals the five values
Algorithm does not total the five values

8

Turn over for the next question

Turn over ►

*25*

IB/G/Jun25/8525/1B

26
1 0

A programmer is writing an algorithm, using pseudo-code, to store the results of
running events.
The programmer uses a record data structure.
Each record stores:
• the name of the running event
• the runner’s number
• the time in seconds for that runner in that event.
Figure 10 shows the record structure.
Figure 10

RECORD Runner
event : String
runnerNumber : Integer
time : Real
ENDRECORD
1 0 . 1

Figure 11 shows pseudo-code used to create two records using the structure in
Figure 10.
Figure 11

race1  Runner('400 m', 23, 51.35)
race2  Runner('400 m', 14, 63.26)
Complete the line of pseudo-code to create a new record that contains the following
data:

event

runnerNumber

time

200 m

10

32.59
[1 mark]

race3 
1 0 . 2

Complete the line of pseudo-code needed to output the time of race2

[1 mark]

OUTPUT race2

*26*

IB/G/Jun25/8525/1B

Do not write
outside the
box

27
1 0 . 3

The programmer wants to find the fastest time for a particular running event.
The times for all the runners in the event are stored in an array of real numbers
called times
Write a Python program to find the fastest time.
Your program must:
• find the smallest value in the array (ie the fastest time)
• output the smallest value
• work with any size of array.
For example, if times contains 28.5, 26.3 and 30.0, the output should be 26.3
The program you write must not use any built-in routines to find the smallest
value in an array or to sort the array into an order.
You do not need to write code to create the array times
You should use indentation as appropriate, meaningful variable name(s) and
Python syntax in your answer.
The answer grid below contains vertical lines to help you indent your code
accurately.

[6 marks]

Turn over ►

*27*

IB/G/Jun25/8525/1B

Do not write
outside the
box

28
Do not write
outside the
box

8

*28*

IB/G/Jun25/8525/1B

29
Do not write
outside the
box

Turn over for the next question

DO NOT WRITE ON THIS PAGE
ANSWER IN THE SPACES PROVIDED

Turn over ►

*29*

IB/G/Jun25/8525/1B

30
1 1

Do not write
outside the
box

A word game is being developed using Python.
A word is displayed as a series of asterisks (*) equal to the number of letters
in the word.
For example, the word apple would be displayed as *****
The player guesses one letter at a time. If the letter is in the word, the letter
will replace the asterisk(s) wherever the letter occurs.
For example, if the player enters p then the word apple will be displayed as

*pp**

Only lower-case letters are used in the word game.
Figure 12 shows a subroutine used in the program for this word game.
• Line numbers are included but are not part of the subroutine.
Figure 12
1
2
3
4
5
6
7
8
1 1 . 1

def findLetter(word, letter, hidden):
newHidden = ""
for i in range(len(word)):
if word[i] == letter:
newHidden = newHidden + letter
else:
newHidden = newHidden + hidden[i]
return newHidden

The subroutine call findLetter("system", "s", "*y**em") is made.
What is the value of the variable letter when line 4 is first executed?
Shade one lozenge.

A

*y**em

B

s

C

sys**m

D

system

*30*

[1 mark]

IB/G/Jun25/8525/1B

31
1 1 . 2

The subroutine call findLetter("system", "s", "*y**em")is made.
What is the value of the variable newHidden when line 6 is first executed?
Shade one lozenge.

1 1 . 3

A

s

B

sys

C

sys**m

D

system

[1 mark]

The subroutine call findLetter("system", "s", "*y**em") is made.
Identify how many times the loop would iterate.
Shade one lozenge.

1 1 . 4

A

1

B

2

C

6

D

7

[1 mark]

The subroutine call findLetter("system", "s", "*y**em") is made.
What value is returned?
Shade one lozenge.

A

s

B

sy*tem

C

sys*em

D

system

[1 mark]

Question 11 continues on the next page
Turn over ►

*31*

IB/G/Jun25/8525/1B

Do not write
outside the
box

32
1 1 . 5

A Python program is being written to determine if a player wins or loses the word
game.
• The player wins if they correctly guess all of the letters in the word within eight
guesses or fewer.
• The player loses if they have had eight guesses and there are still letters remaining
that they have not guessed correctly.
Figure 13 shows the beginning of the program.
Figure 13

word = input()
hidden = ""
for i in range(len(word)):
hidden = hidden + "*"
Extend the program in Figure 13.
Your program must:
• keep repeating the following until the user has had eight guesses or there are no
asterisks left in hidden
o get the user to enter a letter
o call the findLetter subroutine (from Figure 12)
o update the value of hidden using the value returned from findLetter
o display the new value of hidden
• check if the new value of hidden contains any asterisks
o if there are any asterisks in hidden display the message You lost
o if there are no asterisks in hidden display the message You won
The program you write must not use any built-in routines to check if a string
contains another string/character or to count the number of asterisks.
You should use indentation as appropriate, meaningful variable name(s) and
Python syntax in your answer.
The answer grid below contains vertical lines to help you indent your code
accurately.

[10 marks]

word = input()
hidden = ""
for i in range(len(word)):
hidden = hidden + "*"

*32*

IB/G/Jun25/8525/1B

Do not write
outside the
box

33
Do not write
outside the
box

Turn over ►

*33*

IB/G/Jun25/8525/1B

34
Do not write
outside the
box

14
END OF QUESTIONS

*34*

IB/G/Jun25/8525/1B

35
Do not write
outside the
box

There are no questions printed on this page

DO NOT WRITE ON THIS PAGE
ANSWER IN THE SPACES PROVIDED

*35*

IB/G/Jun25/8525/1B

36

Question
number

*36*

Do not write
outside the
box

Additional page, if required.
Write the question numbers in the left-hand margin.

IB/G/Jun25/8525/1B

37

Question
number

*37*

Do not write
outside the
box

Additional page, if required.
Write the question numbers in the left-hand margin.

IB/G/Jun25/8525/1B

38

Question
number

*38*

Do not write
outside the
box

Additional page, if required.
Write the question numbers in the left-hand margin.

IB/G/Jun25/8525/1B

39

Question
number

*39*

Do not write
outside the
box

Additional page, if required.
Write the question numbers in the left-hand margin.

IB/G/Jun25/8525/1B

40
Do not write
outside the
box

There are no questions printed on this page

DO NOT WRITE ON THIS PAGE
ANSWER IN THE SPACES PROVIDED

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.
Copyright © 2025 AQA and its licensors. All rights reserved.

*40*

*256G8525/1B*
IB/G/Jun25/8525/1B

Advertisement