Past-paper question · 2025 May-June · Paper 21 · Q4(a)

Question 4(a) 2025 · May-June · Paper 21 · 5 marks

Original past-paper question for 4(A)
Original past-paper question for 4(A)
Reveal official mark-scheme answer Official mark-scheme answer for 4(A)

Official answer for Question 4

Part (a)

✓
One mark per bullet point. Max 5

Question 5

✓
•
✓
Correct input of number
✓
•
✓
Use of substring ( )
✓
•
✓
…to extract the correct number
✓
•
✓
Correct use of IF statements/Case statement with matching END IF / END CASE
✓
•
✓
Output of matching locations
✓
•
✓
Output of unknown
✓
Example
✓
OUTPUT "Please enter a telephone number "
✓
INPUT Telephone
✓
Value ← SUBSTRING(Telephone, 2, 2)
✓
IF Value = "44"
✓
THEN
✓
OUTPUT "UK"
✓
ELSE
✓
IF Value = "20"
✓
THEN
✓
OUTPUT "Egypt"
✓
ELSE
✓
OUTPUT "Unknown"
✓
ENDIF
✓
ENDIF

Mark scheme 0478_s25_ms_21.pdf →

Show text version of question

Question 4

Part (a)

Question 4

A telephone number with 13 characters is input. The first character is a ‘+’, followed by a 2-digit

country code, for example:

+20xxxxxxxxxx where 20 is the country code and x is a digit between 0 and 9 inclusive.

The algorithm includes checks for the country codes: 44 for the UK and 20 for Egypt.

Part (a)

Write an algorithm using pseudocode to:

  • input the telephone number
  • extract the 2-digit country code
  • output the matching country
  • output ‘Unknown’ if there is no matching country.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[5]

Question 5

, ,

Topic relevance

Why this question appears here

94% assigned-topic match · Programming › Programming concepts

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 0478_s25_qp_21.pdf

Keep practising this topic