Past-paper question · 2023 May-June · Paper 22 · Q11(b)

Question 11(b) 2023 · May-June · Paper 22 · 4 marks

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

Official answer for Question 11

Part (b)

✓
One mark for each point (max four)

Question 4

✓
converting P to upper case
✓
finding the length of P
✓
using a loop to check for position of Q
✓
using the string operation substring
✓
storing the loop counter in Position if the value is found
✓
For example:
✓
P UCASE(P)
✓
Counter 1
✓
Position 0
✓
REPEAT
✓
IF SUBSTRING(P, Counter, 1) = Q
✓
THEN
✓
Position Counter
✓
ENDIF
✓
Counter Counter + 1
✓
UNTIL Position <> 0 OR Counter = LENGTH(P)

Mark scheme 0478_s23_ms_22.pdf →

Show text version of question

Question 11

Part (b)

Question 11

The variables P and Q are used to store data in a program. P stores a string. Q stores a character.

Part (b)

Write a pseudocode algorithm to:

  • convert P to upper case
  • find the position of Q in the string P (the first character in this string is in position 1)
  • store the position of Q in the variable Position

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

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

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

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

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

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

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

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

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

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

[4]
Topic relevance

Why this question appears here

98% 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_s23_qp_22.pdf

Keep practising this topic