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() (i) Write program code for the main program. (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.
Exam No:9618_s25_qp_41 Year:2025 Question No:2(e)
Answer:


Knowledge points:
20.2 File Processing and Exception Handling
Solution:
Download APP for more features
1. Tons of answers.
2. Smarter Al tools enhance your learning journey.
IOS
Download
Download
Android
Download
Download
Google Play
Download
Download