THEME: INFORMATION AND COMMUNICATION TECHNOLOGY (ICT)
DATE:
CLASS: SSS 2
TIME:
PERIOD:
DURATION:
SUBJECT: COMPUTER STUDIES
UNIT TOPIC: Handling Computer files
LESSON TOPIC: Basic operations on computer files and steps involve in creating and
accessing sequential file.
SPECIFIC OBJECTIVES: At the end of the lesson, students should be able to:
1. List basic operations on computer files
2. Explain steps involve in creating sequential file.
3. Explain steps involve in accessing sequential file.
INSTRUCTIONAL RESOURCES:
PRESENTATION: (Content Development)
STEP 1: Identification of Prior Ideas
Mode: Individual
Teacher’s activities: The teacher asks students to
Students’ activities: Students respond to teacher's questions.
STEP 2: Exploration
Mode: Individual/group
Teacher’s activities: The teacher displays the instructional resources and asks students
to identify the resources and states it.
Students’ activities: Students carry out teacher's instructions.
STEP 3: Discussion
Mode: Entire class
Teacher’s activities: The teacher with the use of instructional resources guides students
on the following.
DEFINITION OF TERMS
Basic operations on computer files.
Steps involve in creating and accessing sequential file.
The following are some operations that can be performed on a computer file;
(i) File creation: Creating a file with a given name
(ii) File Deletion: Deleting files that are no longer wanted
(iii) File retrieval: Retrieving a lose file or stored file.
(iv) File copy: Copying a created file to either an external or in-built storage device.
(v) File view: Viewing a created file or granting privilege of viewing.
(vi) File Update: Reading or changing the content of a file.
(vii) File Open: Opening the content of a file on the screen.
(viii) File Close: Losing access to a file by closing, until it is opened again.
EVALUATION:
1. Outline five (5) basic operations on a computer file
Sub-Topic 2: STEPS INVOLVED IN CREATING AND ACCESSING SEQUENTIAL
FILES.
Meaning of Sequential File: A sequential file is a file that is read from start to finish,
character by character or line by line in a chronological order.
The following are steps involved in the creation of sequential files:
The OPEN statement is used to open files or write information to a file. That is, it makes files
available so that Basic can read or write to them. In general, the open statement follows this
pattern: OPEN file$ FOR OUTPUT AS #1.
File$ determines the filename to use,
FOR indicates how the file will be accessed or operated, it may be APPEND, BINARY,
INPUT, OUTPUT and RANDOM.
AS# is the identifier used for the file handle in.
1. OPEN "filename" FOR mode AS #filenumber
2. Write data to the file using the PRINT# or WRITE# statements:
PRINT#1, A$
PRINT#1, B$
PRINT#1, C$
3. CLOSE#1
4. To access the data in the file, you must close the file and reopen it in input mode:
to open: OPEN “I”, mode #1,” filename
5. Use the INPUT# or LINE INPUT# mode to the read data from the sequential file into
the program: INPUT#, X$,Y$,Z$
The example below can help us access a sequential file:
10 OPEN “I”, #1, “DATA”
20 INPUT#1, N$, D$, H$
30 IF RIGHT$ (H$, 2) =”78” THEN PRINT N$
40 GOTO 20
50 CLOSE #1
RUN
JOHN AYO
SUPERMANN
Input past end in 20
OK
EVALUATION:
1. List the steps involved in creating sequential files.
2. What is a sequential file?
Students’ activities: Students participate in the lesson.
STEP 4: Application
Mode: Individual
Teacher’s activities: The teacher asks students to summarize what they have learnt
Students’ activities: Students carry out teachers instructions
STEP 5: Evaluation
Mode: Entire class/Individual
Teacher’s activities: The teacher asks students the following questions:
1. Outline five (5) basic operations on a computer file.
2. Steps involve in creating sequential file.
3. Explain steps involve in accessing sequential file.
Students’ activities: The students answer the teacher’s question
Assignment: List the steps involved in creating sequential files
References:
1: Computer studies for Beginners Book 2 by Adekunle O.
2: Computer studies for Senior Secondary Education (ss1-3) Author HIIT Plc.