Past-paper question · 2025 May-June · Paper 41 · Q2(e)(ii)

Question 2(e)(ii) 2025 · May-June · Paper 41 · 2 marks

Original past-paper question for 2(E)(II)
Original past-paper question for 2(E)(II)
Original past-paper question for 2(E)(II)
Reveal official mark-scheme answer Official mark-scheme answer for 2(E)(II)Official mark-scheme answer for 2(E)(II)

Official answer for Question 2

Part (e)

(ii)

Question 1

mark screenshots showing

Question 2

  • Prompt and input of filename TheData.txt
  • Screenshot of data in red file. Filename must be shown in same screenshot as data
✓
9618/41
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2025
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_s25_ms_41.pdf →

Show text version of question

Question 2

Part (e)

(ii)

Question 2

A program reads data from a text file, splits the data depending on its content and stores the

separated data into different files.

The text file TheData.txt contains 72 lines of data. Each line of data has an integer number and a string colour that are separated by a comma. For example, the first line in the file is:

10,red

The integer is 10 and the string is "red"

The file contains six different colours: red, green, blue, orange, yellow, pink. The main program calls ReadData() and then SplitData()

(ii)

Test your program. Input the text "TheData.txt" when prompted.

Take a screenshot of the output(s) and a screenshot showing the content of the file that stores the red numbers.

Save your program.

Copy and paste the screenshot(s) into part 2(e)(ii) in the evidence document.

[2]

Question 6

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Programming basics

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 9618_s25_qp_41.pdf

Keep practising this topic