Expert Answers

1. (TCO 13) _____ are files from which data is read. (Points : 3)
Output files
Input files
Active files
Sequential files

2. (TCO 13) When storing and retrieving data, a sequential access file is much like a _____. (Points : 3)
floppy disk
book
hard disk
VCR tape

3. (TCO 13) When reading data from a sequential file, the data will be _____. (Points : 3)
read in alphabetical order
sorted from smallest to largest
in key field order
in the order in which it was written

4. (TCO 13) To create an output file object, you would use what kind of type? (Points : 3)
ifstream
ofstream
fstream
instream

5. (TCO 13) What do the following statements accomplish?
ifstream theFile;
theFile.open( myFile.txt , ios::cur); (Points : 3)
Opens myFile in read mode
Opens myFile in current mode
Calculates the offset from current file pointer
Calculates the offset from the current mode

6. (TCO 13) When a file is opened in output mode, the file pointer is positioned _____. (Points : 3)
at the end of the file
at the beginning of the file
in the middle of the file
after the file header

7. (TCO 13) The is_closed function returns what kind of data type? (Points : 3)
bool
int
char
double

8. (TCO 13) In general, which of the following contains the least amount of data? (Points : 3)
A database
A file
A byte
A field

9. (TCO 13) Given the following statements:

ifstream theFile;
theFile.open( myFile.txt , ios::in);

What function would close this file? (Points : 3)
ifstream.close();
ifstream.close( myFile.txt );
theFile.close();
ifstream.thefile.close;

10. (TCO 13) In order to perform file processing in C++, which header files must be included? (Points : 3)
, , and
and
and
and
iostream and fstream

11. (TCO 13) Compare and contrast the mode operators ios::in, ios::app, and ios::out. Provide a C++ code segment that illustrates the use of these mode operators. (Points : 5)