Wednesday, February 26, 2020

SET 11 - File handling----SEE Computer Science 2076 --- Practice Day 11 --- 15 Questions

SET 11 - File handling----SEE Computer Science 2076 --- Practice Day 11 --- 15 Questions


Handling of data file

Questions and Answers

1.      Mode of data file [SLC 2069]
Mode of data file means opening a sequential file for one of the three modes of operation like output mode, input mode and append mode.
2.      Modes of operation for opening a sequential file
a)      Output Mode: It is used to create a new data file and write data in it. If the file already exists its current contents will be destroyed.
b)     Input Mode: It is used to retrieve records or contents of existing data file.
c)      Append Mode: It is used to add more records in existing file. If the specified file does not exist APPEND mode creates it.
Write down the functions of:
3.      WRITE statement [SEE 2075] [MM 2076]: It sends one or more data items to the specified file. It inserts commas between the data items. It encloses strings in double quotation marks.
4.      CLOSE statement [SEE 2074] [SEE 2073: It closes one or all open files.
5.      INPUT# statement [SEE 2075 U] [SEE 2075 S 2]: It reads data from the sequential data file.
6.      EOF( ) function [SEE 2075 S 2]: It is used to test the end of records with in a file.
7.      NAME statement [SEE 2073] [SLC 2071 S]: The NAME statement renames a file on a diskette. Only file name changes, data and program line remains intact.
8.      KILL statement [SEE 2074]: The KILL statement deletes the file or files from the specified drive and directory.
9.      MKDIR statement [SEE 2075 U]: It creates a subdirectory which is used to manage files.
10.   RMDIR statement [SLC 2065] [SLC 2068 S]: It is used to remove or delete only the subdirectories from a disk. It can remove only empty subdirectories.
11.   FILES statement: The FILES statement displays the files of the current sub directory or specified sub directory.
12.   INT [MM 2076] [MFT 2075]: It rounds and returns the largest integer less than or equal to a numeric expression.
13.   MID$ ( ) [MFT 2075]: It is a string function that returns the specified number of characters from the specified location of string.
14.   LEN ( ) [SQE 2074K]: Returns the number of characters in a string or the number of bytes required to store a variable.
15.   SQR ( ) [SQE 2074K]: Returns the square root of a numeric expression.

No comments:

Post a Comment