Course Content
Paper 2 – Problem Solving Approach -Practical
0/102
Past Paper-2 May/June 2025
Past Paper-1 May/June 2025
Download Files
0/1
Olevel : Computer Science 2210 / IGCSE 0478 : Recorded

In this video, we learn how file handling in READ mode works using a simple pseudocode example from the Computer Science syllabus. When data is saved in a file, it is stored permanently on secondary storage such as a hard disk, but to use that data again, the program must read it. READ mode is used to retrieve information from a file without changing or deleting any existing data, making it a safe way to access stored records. In the given example, a teacher has already saved student names in a file called STUDENTS.TXT and now wants to display a student’s name on the screen. The pseudocode begins by opening the file in READ mode so the program can access its contents. The file name is then specified to ensure the correct file is used. Next, a variable is declared as a STRING to temporarily store the data read from the file. The READ command retrieves the data from the file and places it into the variable, after which the OUTPUT statement displays this data on the screen. Finally, the file is closed properly, which is important for freeing system resources and ensuring safe program execution. By following the correct sequence—open the file, declare a variable, read the data, display it, and close the file—students can clearly understand how reading from a file works and can confidently answer file-handling questions in their O-Level Computer Science exams.

You cannot copy content of this page