AQA GCSE Computer Science Paper 1, June 2025: question 11

A PrepWise guide to a real paper, with our descriptions and answers. Not made or approved by AQA.

PrepWise guide: AQA GCSE Computer Science Paper 1Question 1111 of 11

A word game is written in Python. The word shows as one asterisk per letter, for example ***** for apple. The player guesses one lower-case letter at a time, and each correct guess reveals that letter wherever it occurs, so p turns apple into *pp**. Figure 12 is the subroutine findLetter, which builds the new display, and Figure 13 starts the main program. The player wins by finding every letter within eight guesses, and loses after eight guesses with letters still hidden. The last part ends with the message You won or You lost, and in it built-in routines that check whether a string contains another string or a character, or that count the asterisks, are not allowed.

Figure 12
A Python subroutine of eight numbered lines.Open full size to read the labels (Figure 12, opens in a new tab)
Figure 13
The first four lines of a Python program.Open full size to read the labels (Figure 13, opens in a new tab)
11.1[1 mark]

Passing "system", "s" and "*y**em" to findLetter, pick the value held by letter when line 4 of Figure 12 first runs.

See how you would score on Trace Tables

Our own questions on this topic, marked straight away, so you see what to revise. Free now.

*y**em
sCorrect answer
sys**m
system
Show model answer for 11.1Hide model answer for 11.1

s. The second value in the call is passed to the parameter letter, so it holds "s".

1 mark

How the marks are earned

  1. s.
  2. Choosing more than one option earns nothing.
Revise Trace Tables
11.2[1 mark]

In the same call, choose the value of newHidden the first time line 6 of Figure 12 is reached.

See how you would score on Trace Tables
sCorrect answer
sys
sys**m
system
Show model answer for 11.2Hide model answer for 11.2

s. On the first pass the letter at position 0 matches, so "s" is added to newHidden. Line 6 is first reached on the next pass, when newHidden still holds just "s".

1 mark

How the marks are earned

  1. s.
  2. Choosing more than one option earns nothing.
Revise Trace Tables
11.3[1 mark]

In the same call, choose how many times the loop in Figure 12 repeats.

See how you would score on Trace Tables
1
2
6Correct answer
7
Show model answer for 11.3Hide model answer for 11.3

6. The loop runs once for each letter of "system", and the word has 6 letters.

1 mark

How the marks are earned

  1. 6.
  2. Choosing more than one option earns nothing.
Revise Trace Tables
11.4[1 mark]

In the same call, choose the value that findLetter returns.

See how you would score on Trace Tables
s
sy*tem
sys*emCorrect answer
system
Show model answer for 11.4Hide model answer for 11.4

sys*em. Each "s" in the word is kept as "s", and every other position copies the old hidden character. So y, e and m stay, and position 3 stays as an asterisk.

1 mark

How the marks are earned

  1. sys*em.
  2. Choosing more than one option earns nothing.
Revise Trace Tables
11.5[10 marks]

Extend Figure 13: up to eight times, or until no * remains, input a letter, call findLetter, update hidden, show it; report win or loss.

See how you would score on Iteration (Loops)
Show model answer for 11.5Hide model answer for 11.5
word = input()
hidden = ""
for i in range(len(word)):
   hidden = hidden + "*"
guesses = 0
all_found = False
while guesses < 8 and not all_found:
   guess = input()
   hidden = findLetter(word, guess, hidden)
   print(hidden)
   guesses = guesses + 1
   stars_left = 0
   for position in range(len(hidden)):
      if hidden[position] == "*":
         stars_left = stars_left + 1
   if stars_left == 0:
      all_found = True
if all_found:
   print("You won")
else:
   print("You lost")

If all_found is still False after the loop, eight guesses were used and asterisks remain, so the player lost.

10 marks

How the marks are earned

  1. A new iteration structure is created and a letter is input inside it (design mark).
  2. A selection structure is used for both the winning and the losing messages (design mark).
  3. The loop lets a letter be typed up to 8 times, and never more. Any part of the loop condition about asterisks is ignored for this mark.
  4. The iteration structure also ends when no asterisks are left in hidden, with a correct Boolean operator joining both conditions. A loop of 8 that stops early with a break when no asterisks remain is also accepted.
  5. The loop body calls findLetter; wrong or absent arguments do not matter for this mark.
  6. The arguments are right and in the right order: the word, then the guessed letter, then hidden. The guessed letter must be the same variable that the typed letter went into.
  7. hidden is updated from the value findLetter returns. Setting hidden to an empty string again inside the loop earns nothing.
  8. The program correctly checks whether any asterisks are left in hidden and deals with the result.
  9. The value of hidden is displayed after each guess.
  10. You won and You lost are displayed in suitable places, under the correct conditions.
  11. A built-in routine that searches for another string or a character in a string, or counts the asterisks, loses the marks for ending the loop on a full word and for checking the asterisks.
  12. The case of the code is ignored; messages with input statements are optional; gaps are ignored unless they change the logic.
  13. If the code has any error, the maximum is 9 marks.
  14. The design mark is for choosing a suitable technique and is credited whether or not the syntax is correct and whether or not the program works.

Why it scores

The first four lines are the given start. The while loop is the new iteration with the letter input inside it, and it stops at 8 guesses or when all_found becomes True, with and joining both conditions. Each pass calls findLetter(word, guess, hidden) with the guessed letter in the middle, stores the result back in hidden and prints it. A manual count in stars_left checks for asterisks without a built-in routine. The if and else at the end give the won or lost message.

This is why the final selection can use the flag alone: the loop only ends with the flag False when all eight guesses have been made.

Revise Iteration (Loops)
AQA owns the copyright in its exam questions, so we cannot copy their wording. These descriptions and answers are ours. Not made or approved by AQA.[14 marks]