Past-paper question · 2024 May-June · Paper 21 · Q7(b)

Question 7(b) 2024 · May-June · Paper 21 · 4 marks

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

Official answer for Question 7

Part (b)

✓
One mark per mark point, max four

Question 4

✓
MP1
✓
Declaration of a string variable
✓
MP2
✓
Correct use of OPENFILE keywords for reading
✓
MP3
✓
Correct use READFILE with string variable
✓
MP4
✓
Correct use of UCASE and LENGTH functions and output of each
✓
MP5
✓
Correct use of CLOSEFILE
✓
Example:
✓
DECLARE Words : STRING
✓
OPENFILE Quotation.txt FOR READ
✓
READFILE Quotation.txt, Words
✓
OUTPUT UCASE(Words), LENGTH(Words)
✓
CLOSEFILE Quotation.txt
✓
2210/21
✓
Cambridge O Level – Mark Scheme
✓
May/June 2024
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 2210_s24_ms_21.pdf →

Show text version of question

Question 7

Part (b)

Part (b)

The function LENGTH(X) calculates the length of a string X

Write the pseudocode statements to:

  • read the contents of the text file Quotation.txt into an appropriate string variable that
  • has been declared

  • output the string in upper case and the length of the string.

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

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

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

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

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

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

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

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

[4]

Question 9

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 2210_s24_qp_21.pdf

Keep practising this topic