Chapter Questions
Where are files normally stored?
What is an output file?
What is an input file?
What three steps must be taken by a program when it uses a file?
In general, what are the two types of files? What is the difference between these two types of files?
What are the two types of file access? What is the difference between these two?
When writing a program that performs an operation on a file, what two fileassociated names do you have to work with in your code?
In most programming languages, if a file already exists what happens to it if you try to open it as an output file?
What is the purpose of opening a file?
What is the purpose of closing a file?
Generally speaking, what is a delimiter? How are delimiters typically used in files?
In many systems, what is written at the end of a file?
What is a file's read position? Initially, where is the read position when an input file is opened?
In what mode do you open a file if you want to write data to it, but you do not want to erase the file's existing contents? When you write data to such a file, to what part of the file is the data written?
Design an algorithm that uses a For loop to write the numbers 1 through 10 to a file.
What is the purpose of the eof function?
Is it acceptable for a program to attempt to read beyond the end of a file?
What would it mean if the expression eof(myrile) were to return True?
Which of the following loops would you use to read all of the items from the file associated with myPile?a. While eof (mypile) Read myrile item End Whileb. While NOT eof (myFile) Read myFile item End While
What is a record? What is a field?
Describe the way that you use a temporary file in a program that modifies a record in a sequential access file.
Describe the way that you use a temporary file in a program that deletes a record from a sequential file.