0% found this document useful (0 votes)
30 views2 pages

File Handling Programming Assignment

The document describes tasks for a program to search a text file containing computing terms and descriptions. It involves creating a sample text file with terms and descriptions, displaying a menu, and coding two menu options - one to search for a term and display its description, and another to search descriptions for a keyword and display any matching terms.

Uploaded by

omerkaleem2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

File Handling Programming Assignment

The document describes tasks for a program to search a text file containing computing terms and descriptions. It involves creating a sample text file with terms and descriptions, displaying a menu, and coding two menu options - one to search for a term and display its description, and another to search descriptions for a keyword and display any matching terms.

Uploaded by

omerkaleem2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

TASK 3

Key focus: File handling using a text file


String handling built-in functions

TASK 3.1

Using a text editor, create a sample text file containing a set of computing terms, each followed by a
one line description.

The typical file contents will be as shown below with each term and description on alternate lines.

serial
file organisation with data items in no particular order
sequential
file organisation where the data items are in some key field order
file
collection of data items
input
file mode which allows data to be written to the file
output
file mode which allows data to be read from the file
append
file mode which allows new data items to be added to the end of the file
FILEREAD
pseudocode term to read a data item from a file
FILEWRITE
pseudocode term to write a data item to a file
EOF
pseudocode for a function which returns TRUE/FALSE to indicate whether the end of file has been
reached

TASK 3.2

Write code to produce a menu for the user as shown.

TASK 3.3

Code option 1 on the menu as a procedure SearchByTerm which:

• prompts the user for the search term


• searches the file for the term and reports either:
o FOUND ... followed by its description, or
o TERM NOT FOUND
4

Typical output using the sample file would be:

TASK 3.4

Code option 2 on the menu as a procedure SearchDescriptionsForKeyword which:

• prompts the user for the keyword


• searches all the descriptions in the file for the presence of that keyword and reports either:
o the one or more terms whose description contained the keyword, or
o NO DESCRIPTIONS FOUND containing this keyword.

Typical output using the sample file would be:

You might also like