Worked solution from the Programming Paper 2 Algorithms, Programming and Logic booklet, Part 1 of 3.
Store the string, then use LENGTH and UCASE.
Phrase ← "The beginning is the most important part" OUTPUT LENGTH(Phrase) OUTPUT UCASE(Phrase)
String stored in Phrase [1]
LENGTH(Phrase) used and its result output [1]
UCASE(Phrase) used and its result output [1]
Count every character including spaces: the length is 40.
Write: 40 [1]
Write: THE BEGINNING IS THE MOST IMPORTANT PART [1]
▶ Whole paper
Video solution of the whole paper · by ZAINEMATICS. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.