File Handling In QBASIC Important Question Answer Class 10 Computer Science
1. What is a program file?
Ans: A file that
has a set of instructions and can perform a task when it is executed is known as a program
file.
2. What is a data file?
Ans: Data
file is the collection of related data stored in memory.
3.
What
are the different modes of file handling?
Ans: The
different file modes are listed below:
OUTPUT mode -To create a new data
file and write data in it.
INPUT mode -To
retrieve /read the contents of the existing data file.
APPEND mode - To
add more records to the existing file.
4. Functions and statements used in file
handling:
INPUT # statement: It is used to read
the data of a sequential file and stores them in variable.
LINE INPUT- # statement: It reads an entire line from a sequential file
and assign to a string variable.
EOF() Function: This function is used
to check the end of file.
INPUT$ Function: It is used to return a
part of a string from a file.
FILES statement: This statement
displays a list of files of a disk or a directory.
KILL statement: This statement is used
to delete files.
NAME statement: This statement renames
a file.
CHDIR statement: This statement changes
a drive's default directory.
MKDIR statement: This statement creates
a new directory or subdirectory.
RMDIR statement: This statement removes a subdirectory (folder).
SHELL
Command: This command is used to exit temporarily from the QBASIC
environment to DOS prompt.
SYSTEM command: This command closes all
the files and exits permanently from the QBASIC.
All in all
ReplyDelete