Computer Science · May / June 2025 · Paper 22 · Question 6
2210
As printed in the paper
The question as text
This pseudocode is an algorithm. DECLARE Word : STRING DECLARE V1 : INTEGER DECLARE V2 : INTEGER DECLARE Number : INTEGER DECLARE Index : INTEGER DECLARE L1 : CHAR DECLARE L2 : CHAR DECLARE Continue : BOOLEAN INPUT Number FOR Index 1 TO Number INPUT Word Continue TRUE V1 1 V2 LENGTH(Word) WHILE Continue = TRUE AND V1 < V2 DO L1 SUBSTRING(Word, V1, 1) L2 SUBSTRING(Word, V2, 1) IF L1 <> L2 THEN Continue FALSE ELSE V1 V1 + 1 V2 V2 – 1 ENDIF ENDWHILE IF Continue = TRUE THEN OUTPUT "Successful" ELSE OUTPUT "NOT successful" ENDIF NEXT Index
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
6(a)[6]
6(b)[1]
6(c)[3]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

