Class: Senior Secondary School 2 (SS2 / SSS2)
Term: 2nd Term
Week: 3
Age: 16 years
Duration: 45 minutes
Subject: Computer Studies
Curriculum Theme: Computer Applications
Previous Lesson: Computer Files: Organization Types, Access Methods and Classification.
Topic: HANDLING COMPUTER FILE
Subject Matter: Meaning of handling computer files (managing files through operations and processing), basic operation on computer files (creation, deletion, copy, retrieval, view, update, open, close), steps involved in creating sequential file, steps involved in accessing sequential file (using BASIC processing statements)
Specific Objectives
By the end of the lesson, pupils should be able to:
Cognitive Domain:
- Define computer file handling.
- List basic operations performed on computer files.
- Outline the steps for creating a sequential file using BASIC.
- Outline the steps for accessing a sequential file using BASIC.
Affective Domain:
- Appreciate the importance of proper file management.
- Develop an interest in practical file operations.
Psychomotor Domain:
- Perform basic file operations (e.g., creating, deleting, copying) in a simulated environment.
- Demonstrate the steps for creating and accessing sequential files.
Social Domain:
- Collaborate with peers to discuss file handling concepts.
- Share knowledge on efficient file management practices.
Reference Materials
The following resources were used in planning this lesson:
- Senior Secondary Schools Education Curriculum
- State Unified Scheme of Work
- W.M. Akande. (2018). Comprehensive Computer Studies for Senior Secondary Schools 2. Aflon Limited.
- Computer system, BASIC programming examples, sample sequential file printout, workbook
Instructional Materials
The teacher will teach this lesson with the aid of:
- Computer system
- BASIC programming examples
- Sample sequential file printout
- Workbook
Rationale for the Lesson
This lesson helps pupils understand how to manage digital information effectively. Learning file handling is important for organizing data, preventing loss, and efficiently using computer systems in various tasks and future careers.
Prerequisite/Previous Knowledge
Pupils should have basic knowledge of computer systems, operating systems, and an introduction to programming concepts.
Lesson Content/Board Summary
Handling Computer Files
Meaning of Handling Computer Files
Handling computer files refers to the process of managing and manipulating digital files stored on a computer system. This involves performing various operations to organize, store, retrieve, and process data efficiently.
Basic Operations on Computer Files
The following are common operations performed on computer files:
- Creation: Making a new file.
- Deletion: Removing an existing file.
- Copying: Making a duplicate of a file.
- Retrieval: Finding and accessing an existing file.
- Viewing: Displaying the content of a file.
- Updating: Modifying the content of an existing file.
- Opening: Making a file available for use by a program.
- Closing: Releasing a file after use by a program.
Steps Involved in Creating a Sequential File Using BASIC
A sequential file stores data records one after another. To create a sequential file in BASIC, follow these steps:
- Open the file: Use the `OPEN` statement to open a file for output.
Example:
OPEN "O", #1, "STUDENTS.DAT"(Opens STUDENTS.DAT for Output as file #1) - Input data: Read data from the user or another source.
Example:
INPUT "Enter student name: ", NAME$INPUT "Enter score: ", SCORE - Write data to file: Use the `PRINT #` or `WRITE #` statement to write data to the opened file.
Example:
PRINT #1, NAME$; ","; SCORE(Writes name and score separated by comma to file #1) - Loop for multiple records: Use a loop structure (`DO…LOOP` or `FOR…NEXT`) to write multiple records until a specific condition is met (e.g., user enters “END”).
Example:
DO
INPUT "Enter student name (or 'END' to finish): ", NAME$
IF NAME$ = "END" THEN EXIT DO
INPUT "Enter score: ", SCORE
PRINT #1, NAME$; ","; SCORE
LOOP - Close the file: Use the `CLOSE` statement to close the file after all data has been written.
Example:
CLOSE #1
Steps Involved in Accessing a Sequential File Using BASIC
To access (read from) a sequential file in BASIC, follow these steps:
- Open the file: Use the `OPEN` statement to open a file for input.
Example:
OPEN "I", #1, "STUDENTS.DAT"(Opens STUDENTS.DAT for Input as file #1) - Read data from file: Use the `INPUT #` statement to read data from the opened file.
Example:
INPUT #1, NAME$, SCORE(Reads name and score from file #1) - Loop to read all records: Use a loop structure and the `EOF` (End Of File) function to read all records until the end of the file is reached.
Example:
DO WHILE NOT EOF(1)
INPUT #1, NAME$, SCORE
PRINT "Student: "; NAME$, "Score: "; SCORE
LOOP - Close the file: Use the `CLOSE` statement to close the file after all data has been read.
Example:
CLOSE #1
Teaching Methods/Instructional Techniques
Discussion, Lecture, Demonstration, Question and Answer, Visual Aids
Instructional Procedures
Step 1: Introduction
Time: 5 minutes
Teaching Skill: Set Induction
Teacher’s Activity: The teacher greets the pupils and asks them what they understand by “file” in a general sense (e.g., school file, document file). The teacher then relates this to computer files.
Pupils’ Activity: Pupils respond to the teacher’s questions and share their understanding of files.
Learning Point: Pupils recall prior knowledge and connect it to the lesson topic.
Step 2: Explanation of Handling Computer Files
Time: 7 minutes
Teaching Skill: Explanation/Lecture
Teacher’s Activity: The teacher explains the meaning of handling computer files, emphasizing that it involves managing and manipulating digital data.
Pupils’ Activity: Pupils listen attentively and ask questions for clarification.
Learning Point: Pupils understand the concept of computer file handling.
Step 3: Basic Operations on Computer Files
Time: 8 minutes
Teaching Skill: Listing/Demonstration
Teacher’s Activity: The teacher lists and briefly explains the basic operations on computer files such as creation, deletion, copying, retrieval, viewing, updating, opening, and closing. The teacher might demonstrate some of these using an operating system interface.
Pupils’ Activity: Pupils take notes and observe the demonstrations.
Learning Point: Pupils identify and understand various file operations.
Step 4: Steps for Creating a Sequential File
Time: 8 minutes
Teaching Skill: Explanation/Illustration
Teacher’s Activity: The teacher outlines the steps involved in creating a sequential file using BASIC programming statements, providing examples of `OPEN`, `INPUT`, `PRINT #`, and `CLOSE` statements.
Pupils’ Activity: Pupils write down the steps and the corresponding BASIC statements.
Learning Point: Pupils learn the procedural steps and BASIC commands for file creation.
Step 5: Practical Illustration (Simulated)
Time: 5 minutes
Teaching Skill: Demonstration
Teacher’s Activity: The teacher projects a simple BASIC program for creating a sequential file (e.g., for student names and scores) and explains how it works line by line, simulating the execution.
Pupils’ Activity: Pupils observe the program and ask questions about the code.
Learning Point: Pupils see a practical application of file creation steps.
Step 6: Steps for Accessing a Sequential File
Time: 7 minutes
Teaching Skill: Explanation/Illustration
Teacher’s Activity: The teacher explains the steps involved in accessing (reading from) a sequential file using BASIC, providing examples of `OPEN`, `INPUT #`, `EOF`, and `CLOSE` statements.
Pupils’ Activity: Pupils take notes on the steps and BASIC statements for file access.
Learning Point: Pupils learn the procedural steps and BASIC commands for file access.
Step 7: Evaluation/Review
Time: 5 minutes
Teaching Skill: Questioning/Assessment
Teacher’s Activity: The teacher evaluates the learning by asking the following questions:
- What is meant by handling computer files?
- List any three basic operations you can perform on a computer file.
- State the BASIC statement used to open a file for output.
- Describe two steps involved in creating a sequential file.
Pupils’ Activity: Pupils answer orally and in writing.
Learning Point: Pupils demonstrate understanding of the lesson.
Step 8: Conclusion
Time: 3 minutes
Teaching Skill: Summarization
Teacher’s Activity: The teacher summarizes the key points of the lesson, reinforcing the importance of file handling. The teacher assigns homework: “Write a short BASIC program to create a sequential file for five student names and their ages, then another program to read and display them.”
Pupils’ Activity: Pupils listen to the summary and copy the homework assignment.
Learning Point: Pupils consolidate their understanding and are given a task to practice.
Lesson Keywords
- File Handling – The process of managing and manipulating digital files on a computer system.
- Sequential File – A type of file where data records are stored and accessed in a linear, ordered sequence.
- OPEN statement – A BASIC command used to open a file for input or output.
- PRINT # statement – A BASIC command used to write data to a sequential file.
- INPUT # statement – A BASIC command used to read data from a sequential file.
- CLOSE statement – A BASIC command used to close an opened file.
- EOF function – A BASIC function that checks for the End Of File when reading from a file.
Differentiation
For pupils who grasp concepts quickly, the teacher will provide more complex BASIC file handling challenges, such as error handling or searching within a file. For pupils needing more support, the teacher will provide simplified examples and offer one-on-one guidance during practical sessions.
Note for teachers using this lesson plan
Ensure a functional computer system is available for demonstration. If actual BASIC programming cannot be done, use screenshots or a text editor to simulate the code and output. Emphasize the practical implications of file handling in daily computer use.



Community Join the conversation Open discussion +