1)
What is data file? What are
the different types of data file?
Ans: The file which contains
data given by the user to the program and information provided by the user to
the computer is called data file.
The different types of data
file are:
a.
Sequential Access files
b.
Random access files
2) What is a file? Name the two types of data file in data
processing.
Ans: A bunch of bytes stored
on some storage device like magnetic tape, magnetic disk and optical disk is
called file.
The two different types of
file in data processing are:
a.
Program file
b.
Data file
3)
What do you mean by program
file and data file?
Ans) The file which contains
a set of instructions that are needed for data processing is called program
file.
The file which contains only
data that are required during data processing is called data file.
4)
What is sequential access
data file?
Ans) A data file that stores
a sequential data file containing name, address of some people in the same
order or in sequential order is called sequential access data file.
5)
What are the disadvantages
of sequential access data file?
Ans) The disadvantages of
sequential access data file are:
a)
It takes long time to access if the data file contains
a large volume of data.
b)
In sequential access data file we cannot change the
existing entry or insert a new entry.
6)
Mention the difference
between program files and data files.
Ans:
Program files
|
Data files
|
A program file has set of
instructions needed for data processing.
|
A data file has collection
of related data stored in a secondary storage.
|
7)
What are the difference
between PRINT# and WRITE# statements?
Ans:
PRINT#
|
WRITE#
|
It adds spaces between
data items while storing data.
|
It inserts commas between
the data items.
|
It does not enclose
strings in double quotation marks.
|
It encloses strings in
double quotation marks.
|
8)
What is a file number?
Ans: The number assigned to
a file in order to identify it during processing is called file number.
9) List the modes of
operations for opening a sequential file.
Ans: The modes of operation for opening a sequential file are:
i) Output Mode: It is used to create a new data file and write data in it.
ii) Input Mode: It is used to retrieve records or contents of existing data file.
iii) Append Mode: It is used to add more records in existing file.
Ans: The modes of operation for opening a sequential file are:
i) Output Mode: It is used to create a new data file and write data in it.
ii) Input Mode: It is used to retrieve records or contents of existing data file.
iii) Append Mode: It is used to add more records in existing file.
10) Differentiate between
output mode and append mode.
Ans:
Ans:
OUTPUT
mode
|
APPEND
mode
|
i) It creates a new file and prepares to write
data to the file.
|
i) It opens an existing file
and prepares to add data to the file.
|
ii) If the file already exists
its current contents will be destroyed.
|
ii) If the specified file does
not exist APPEND mode creates it.
|
11) Write down the
functions of:
a) OPEN statement:
It opens a sequential file for one of the three possible operations (reading, writing, appending).
b) WRITE statement:
It sends one or more data items to the specified file.
c) CLOSE statement:
It closes one or all open files.
d) INPUT# statement:
It reads data from the sequential data file.
e) EOF() function:
It detects the end of the file marker reading the data from an open sequential file.
f) LINE INPUT statement:
It reads the entire line or maximum 255 characters form the keyboard or the sequential file.
g) INPUT$ function:
It reads the specified number of characters form the data file.
h) NAME statement:
The NAME statement renames a file on a diskette. Only file name changes, data and program line remains intact.
i) KILL statement:
The KILL statement deletes the file or files from the specified drive and directory.
j) MKDIR statement:
It creates a subdirectory which is used to manage files.
k) CHDIR statement:
It allows QBASIC to change from one directory to another.
l) RMDIR statement:
It is used to remove or delete only the subdirectories from a disk. It can remove only empty subdirectories.
m) FILES statement:
a) OPEN statement:
It opens a sequential file for one of the three possible operations (reading, writing, appending).
b) WRITE statement:
It sends one or more data items to the specified file.
c) CLOSE statement:
It closes one or all open files.
d) INPUT# statement:
It reads data from the sequential data file.
e) EOF() function:
It detects the end of the file marker reading the data from an open sequential file.
f) LINE INPUT statement:
It reads the entire line or maximum 255 characters form the keyboard or the sequential file.
g) INPUT$ function:
It reads the specified number of characters form the data file.
h) NAME statement:
The NAME statement renames a file on a diskette. Only file name changes, data and program line remains intact.
i) KILL statement:
The KILL statement deletes the file or files from the specified drive and directory.
j) MKDIR statement:
It creates a subdirectory which is used to manage files.
k) CHDIR statement:
It allows QBASIC to change from one directory to another.
l) RMDIR statement:
It is used to remove or delete only the subdirectories from a disk. It can remove only empty subdirectories.
m) FILES statement:
The FILES statement displays the files
of the current sub directory or specified sub directory.
No comments:
Post a Comment