2210/21/M/J/23 question 8: worked solution (May/June 2023, paper 21)
Show as plain textHide plain text
Cambridge O Level Computer Science 2210 · 8.1 Programming concepts Worked solution from the Programming Paper 2 Algorithms, Programming and Logic booklet, Part 1 of 3. Q18 2210/21/M/J/23 original Q8 Structured · 5 marks Worked solution (a) 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] (b) Count every character including spaces: the length is 40. Write: 40 [1] Write: THE BEGINNING IS THE MOST IMPORTANT PART [1] KEY IDEA LENGTH counts every character, spaces included, and UCASE gives capital letters. TOTAL 5 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by ZAINEMATICS. Tap the picture to open it on YouTube.