Past-paper question · 2024 October-November · Paper 22 · Q10

Question 10 2024 · October-November · Paper 22 · 6 marks

Original past-paper question for 10
Reveal official mark-scheme answer Official mark-scheme answer for 10

Official answer for Question 10

✓
One mark per mark point (max six)

Question 6

✓
•
✓
Declaration of appropriate string variable(s)
✓
•
✓
Input of a line of text
✓
•
✓
Correct use of LCASE
✓
•
✓
Correct use of LENGTH
✓
•
✓
Opening of at least one of the required text files using given names
✓
(Main.txt, Lowercase.txt)
✓
•
✓
Storing of correct line of text to Main.txt
✓
•
✓
Storing of correct lines to Lowercase.txt
✓
•
✓
Closing of both text files
✓
•
✓
Correct output
✓
For example:
✓
DECLARE LineOfText : STRING
✓
DECLARE LowercaseText: STRING
✓
INPUT LineOfText
✓
OPENFILE Main.txt FOR WRITE
✓
WRITEFILE Main.txt, LineOfText
✓
CLOSEFILE Main.txt
✓
LowercaseText LCASE(LineOfText)
✓
OUTPUT LowercaseText, LENGTH(LineOfText)
✓
OPENFILE Lowercase.txt FOR WRITE
✓
WRITEFILE Lowercase.txt, LowercaseText
✓
CLOSEFILE Lowercase.txt
✓
Cambridge IGCSE – Mark Scheme
✓
0478/22
✓
October/November
✓
PUBLISHED
✓
2024
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_w24_ms_22.pdf →

Show text version of question

Question 10

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

Write the pseudocode statements to:

  • allow a line of text to be input to an appropriate variable
  • store this line of text in a text file called Main.txt
  • calculate the length of the line of text and output the text in lower case along with its length
  • store the lower-case line of text in a text file called Lowercase.txt

Make sure that any variables used are declared and that both text files are closed after they have been used.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[6]

Question 10

, ,

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_w24_qp_22.pdf

Keep practising this topic