Com 214 File Organization and Management Practical
Com 214 File Organization and Management Practical
UNESCO
UNESCO-NIGERIA TECHNICAL & VOCATIONAL
EDUCATION REVITALISATION PROJECT
PROJECT-PHASE II
NATIONAL DIPLOMA IN
COMPUTER TECHNOLOGY
Contents
Week 1-2: Program that creates and updates records of a file. ................................................................... 4
Week 3: To create an input form to maintain records of a file. ................................................................ 10
Week 4: To write a program that create and maintaining different file organization. .............................. 14
Weeks 5 – 6: To write a program that create and maintaining file organization. ...................................... 20
Week 7: To load and retrieve documents to and from different storage media. .............................. 25
Week 8: To load and retrieve documents to and from different storage media. .............................. 29
Week 9: To be able to write simple programs involving sequential and random access methods. .......... 32
Week 10: To write programs involving sequential and random access methods. ..................................... 34
Week 11: To write program involving 1 dimensional arrays. ..................................................................... 37
Week 12: To write program involving 2 dimensional arrays.. .................................................................... 40
Week 13: The techniques of stacks and Queues in file organization. ...................................................... 43
Week 14: To write a file access protection and security program. ............................................................ 46
Week 15: To write a file access protection and security program. ............................................................ 48
3
Practical Work – File Organization & Management
WEEK 1
To understand:
How to write a simple program that creates and updates records of a file.
4
Practical Work – File Organization & Management
During this week students are to complete a project named “Week1” to use text boxes to enter
data into a text file created and later access the content of the file back. The main form looks
like this form
How to write a simple program that creates and updates records of a file.
End Sub
5
Practical Work – File Organization & Management
Close #1
End
End Sub
Loop
End Sub
6
Practical Work – File Organization & Management
Name = Txtname
Address = Txtaddress
sex = Txtsex
age = Txtage
Close #1
Txtname.Text = ""
Txtaddress.Text = ""
Txtsex.Text = ""
Txtage.Text = ""
End Sub
i. File
ii. Bit
iii. Nibble
iv. Byte
v. Character
vi. Field
vii. Record
viii. Database
4. Explain what you understand by file extension and give appropriate examples.
_______________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
To understand:
WEEK 2:
To create an input form to maintain records of a file.
During this week students are to create an input Form named “Week3” to use text boxes to
enter data into a sequential text file created. The Form should contain command buttons to
enable user to maintain the data/contents of the file as shown in the diagram below.
How to do this
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
5. Identify the characteristics of a file system under Mac O/S X and file under Microsoft
Windows.
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
13
Practical Work – File Organization & Management
WEEK 3
To understand:
How to write a simple program for creating and maintaining different file
organization.
14
Practical Work – File Organization & Management
During this week students are to complete a project named “Week4” to use text boxes to enter
data into a sequential text file created. The user should be able to maintain the data/content of
the file. The main form should looks like this form
How to write a simple program that creates and updates records of a file.
End Sub
DoCmd.Quit
Exit_Command16_Click:
Exit Sub
Err_Command16_Click:
MsgBox Err.Description
Resume Exit_Command16_Click
End Sub
DoCmd.GoToRecord , , acNewRec
Exit_Command10_Click:
Exit Sub
Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
17
Practical Work – File Organization & Management
Resume Exit_Command13_Click
End Sub
Exit_Command14_Click:
Exit Sub
Err_Command14_Click:
MsgBox Err.Description
Resume Exit_Command14_Click
End Sub
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
________________________________________________________________________
_______________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
19
Practical Work – File Organization & Management
WEEK 4 -6
To understand:
How to write a simple program for creating and maintaining different file
organization.
20
Practical Work – File Organization & Management
During this week students are to complete a project named “Week 5-6” to use text boxes to
enter data into a sequential text file created. The user should be able to maintain the
data/content of the file. The main form should looks like this form
How to write a simple program that creates and updates records of a file.
End Sub
DoCmd.Quit
Exit_Command16_Click:
Exit Sub
Err_Command16_Click:
MsgBox Err.Description
Resume Exit_Command16_Click
End Sub
DoCmd.GoToRecord , , acNewRec
Exit_Command10_Click:
Exit Sub
Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
23
Practical Work – File Organization & Management
Resume Exit_Command13_Click
End Sub
Exit_Command14_Click:
Exit Sub
Err_Command14_Click:
MsgBox Err.Description
Resume Exit_Command14_Click
End Sub
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
WEEK 7
To understand:
How to load and retrieve documents to and from different storage media.
25
Practical Work – File Organization & Management
During this week students are to load and retrieve documents to and from different
storage media, such as diskette, flash disk, HDD, etc
iii. Select the folder/drive in the look in where you want to save your document (that is,
specify the drive – diskette or flash disk or folder in the local disk (HHD))
Note that the diskette or flash disk must be slot/plug onto the appropriate
computer port and recognized by the computer before this operation.
iv. Type the file name in the file name (e.g week 7 Practical) text box.
26
Practical Work – File Organization & Management
Note that the Microsoft word will give file extension to your file name depending
on the type of file specified.
v. Click on the save button
1. What do you observe when saving or storing data into different storage media?
_______________________________________________________________________
_______________________________________________________________________
2. Why is that, the computer is slower when accessing the external disk compared to when
_______________________________________________________________________
_______________________________________________________________________
3. Briefly describe;
i. Primary storage
i. Latency
ii. Throughput.
______________________________________________________________________
______________________________________________________________________
27
Practical Work – File Organization & Management
______________________________________________________________________
28
Practical Work – File Organization & Management
WEEK 8
To understand:
How to load and retrieve documents to and from different storage media.
29
Practical Work – File Organization & Management
Week 8: To load and retrieve documents to and from different storage media.
During this week students are to load and retrieve documents to and from
different storage media, such as diskette, flash disk, HDD, etc
ii. Select Open option to display open dialog box as shown below;
iii. Select the folder/drive in the look in from where you want to retrieve your
document (that is, specify the drive – diskette or flash disk or folder in the local
disk (HHD))
Note that the diskette or flash disk must be slot/plug onto the appropriate
computer port and recognized by the computer before this operation.
iv. Type the file name in the file name (e.g week 7 Practical.docx) text box.
Note that you can select the file name from the list of file names displayed.
v. Click on the save button
30
Practical Work – File Organization & Management
_______________________________________________________________________
________________________________________________________________________
________________________________________________________________________
2. What do you observe when saving or storing data into different storage media?
_______________________________________________________________________
_______________________________________________________________________
3. Why is that, the computer is slower when accessing the external disk compared to
______________________________________________________________________
_______________________________________________________________________
i. CD-ROM
iv. Diskette
v. Magnetic tap
31
Practical Work – File Organization & Management
WEEK 9
LEARNING OUTCOMES
To understand:
Week 9: To be able to write simple programs involving sequential and random access methods.
During this week students are to complete a project named “Week 9” to create sequential file.
The user should be able to maintain the data/content of the file.
How to do this
End Sub
3. Save your project with the name “week 9”.
33
Practical Work – File Organization & Management
WEEK 10
To understand:
Week 10: To write programs involving sequential and random access methods.
During this week students are to complete a project named “Week 10” to create random file.
The user should be able to maintain the data/content of the file.
How to do this
Type single-Record
Record-key as integer
Sname As String*20
Snum as string*10
35
Practical Work – File Organization & Management
End type
End sub
WEEK 11
To understand:
How to write simple program involving 1,2,3 dimensional arrays, stacks and Queues.
37
Practical Work – File Organization & Management
During This Lab we want to Complete a project “Week11” to add the numbers
(0,2,4,………36,38 ) to one dimension array and display it in a text box. The main form looks
like this form
Dim i As Integer
For i = 0 To 19
iMyArray(i) = i * 2
Next i
For i = 0 To 19
LoopMsg = ""
Next i
Text1.Text = FullMsg
WEEK 12
THIS WEEK SPECIFIC LEARNING OUTCOMES
To understand:
How to write simple program involving 1,2,3 dimensional arrays, stacks and Queues.
40
Practical Work – File Organization & Management
During This Lab we want to Complete a project “Week12” to add the numbers (0,38) (2,36)
………(36,2) (38,0 ) to two dimension array and display it in a text box. The main form looks
like this form
Dim i As Integer
Dim j As Integer
For i = 0 To 19
iMyArray(i, 0) = i * 2
iMyArray(i, 1) = 38 - i * 2
Next i
LoopMsg = ""
For i = 0 To 19
For j = 0 To 1
LoopMsg = LoopMsg & BeginMsg & "( " & i & "," & j & " )"
Next j
LoopMsg = ""
Next i
Text1.Text = FullMsg
WEEK 13
To understand:
Students are to study the stacks illustrated by railroad spur in diagrams below and briefly
explain the push and pop operations represented in the diagram
C D C D
B
A A
Push Pop
________________________________________________________________________
________________________________________________________________________
_______________________________________________________________________
1. Define Stack.
________________________________________________________________________
________________________________________________________________________
_______________________________________________________________________
________________________________________________________________________
________________________________________________________________________
_______________________________________________________________________
44
Practical Work – File Organization & Management
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
Service
Input source Queue mechanism Served
Process
5. Enumerate and briefly explain five file processing techniques you know.
________________________________________________________________________
________________________________________________________________________
_______________________________________________________________________
45
Practical Work – File Organization & Management
WEEK 14
THIS WEEK SPECIFIC LEARNING OUTCOMES
To understand:
At the end of this week students are expected write simple program using any of the file
security techniques to protect unauthorized persons from gaining access to data file.
Students Assessment
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
47
Practical Work – File Organization & Management
WEEK 15
To understand:
At the end of this week students are expected write simple program using any of the file
security techniques to protect unauthorized persons from gaining access to data file.
Students Assessment
i. File access,