Past-paper question · 2021 May-June · Paper 21 · Q5(b)(ii)

Question 5(b)(ii) 2021 · May-June · Paper 21 · 2 marks

Original past-paper question for 5(B)(II)
Original past-paper question for 5(B)(II)
Original past-paper question for 5(B)(II)
Reveal official mark-scheme answer Official mark-scheme answer for 5(B)(II)

Official answer for Question 5

Part (b)

(ii)

✓
One mark for each:

Question 2

✓
•
✓
A simplified version of Status()/ a dummy function is written
✓
•
✓
that returns a typical / expected value.

Mark scheme 9608_s21_ms_21.pdf →

Show text version of question

Question 5

Part (b)

(ii)

Question 5

Alice is developing an algorithm for a game. The game will count the number of attempts by a

player to guess the secret number generated by the built-in random number function.

She will use pseudocode to develop a procedure, GuessNum(), that will:

1. generate a secret number that is a random integer in the range 1 to 20 inclusive 2. prompt and input the player’s guess 3. output a message if the guess is not the same as the secret number and repeat from step 2 4. count the number of attempts it takes to guess the secret number 5. output a message when the secret number has been guessed correctly, giving the number of attempts. Alice is converting her pseudocode into a high-level language for use in a larger modular program.

She wants to start testing the program before all the subroutines (procedures and functions) have been implemented.

(ii)

Her program contains a function Status() that she has not yet written, but will be called

from several places within the program.

Explain what Alice needs to do to allow the program to be tested.

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

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

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

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

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

[2]
Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Constructs

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_s21_qp_21.pdf

Keep practising this topic