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 WRITE mode works using a simple pseudocode example from the Computer Science syllabus. When a program runs, any data stored in variables is temporary and is lost once the computer is switched off. To store information permanently, such as student records, we use files. In our example, a teacher wants to save the name of a student attending an extra class so it can be used later. The pseudocode begins by opening a file in WRITE mode, which creates a new file or clears the existing one if it already exists. The file is then named STUDENTS.TXT, which is where the data will be stored. Next, a variable is declared as a STRING to hold the student’s name because names are text data. The program then displays a message asking the user to enter the student’s name, and the entered name is stored in the variable. After that, the WRITE command saves this data into the file. Finally, the file is closed properly, which is a very important step to ensure the data is safely stored on the storage device. By following this correct sequence—open file, declare variable, input data, write data, and close file—students can clearly understand how writing to a file works and can confidently answer file-handling questions in their exams.

You cannot copy content of this page