Past-paper question · 2024 May-June · Paper 22 · Q4(b)(ii)

Question 4(b)(ii) 2024 · May-June · Paper 22 · 2 marks

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

Official answer for Question 4

Part (b)

(ii)

✓
One mark for correct use of SUBSTRING operation, one mark for appropriate test

Question 2

✓
Example:
✓
REPEAT
✓
INPUT Product
✓
UNTIL SUBSTRING(Product, 1, 2) = "PD"
✓
0478/22
✓
Cambridge IGCSE – Mark Scheme
✓
May/June 2024
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_s24_ms_22.pdf →

Show text version of question

Question 4

Part (b)

(ii)

Question 4

A program needs to make sure the characters input for a product code meet these rules:

  • The product code is six characters in length.
  • The first two characters must be “PD”.
  • The last four characters must be a number in the range 1000 to 9999 inclusive.

The program design will include a pseudocode algorithm. Assume that the product code is stored in the variable Product

(ii)

Write the pseudocode to make sure that the first two characters of the product code are

“PD”.

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

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

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

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

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

[2]

Question 4

, ,

Topic relevance

Why this question appears here

99% 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_s24_qp_22.pdf

Keep practising this topic