1. (TCO 13) Files that are accessed in consecutive order are known as _____. (Points : 3)
sequential files
random access files
binary files
consecutive 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) If you want to add data to an new file, what is the correct operation to perform? (Points : 3)
Create file
Append file
Update file
Read and write file
4. (TCO 13) Text files are what type of file? (Points : 3)
Sequential
Random access
Binary
Consecutive
5. (TCO 13) What do the following statements accomplish?
ofstream theFile;
theFile.open( myFile.txt , ios::out); (Points : 3)
Opens myFile in read mode
Opens myFile in append mode
Creates an empty file named myFile
Opens a file in input mode to write to
6. (TCO 13) When a file is opened in the append 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) Which of the following functions should be used to determine if a file was successfully opened? (Points : 3)
is_active
is_open
is_closed
is_ready
8. (TCO 13) What is the data hierarchy arranged from largest to smallest? (Points : 3)
File, field, record, byte, bit
File record, field, bit, byte
File, record, field, byte, bit
Record, file, field, bit, byte
9. (TCO 13) To use an input file, the program must include _____. (Points : 3)
fstream
instream
outstream
filestream
10. (TCO 13) Which of the following does not have a stream associated with it? (Points : 3)
cerr
cin
cout
All of the above have streams associated with them.
11. (TCO 13) Create a writeData method snippet of code using NAME and State as variables. Collect the information and write it to file. (Points : 5)
ANSWER:
/*
Create a writeData method snippet of code using NAME and State as variables.
Collect the information and write it to file.
*/
#include<iostream>
Files that are accessed in consecutive order are known as
- Technology: Multiple-Choice-Questions
- Code: SHC_MCQ_10021
-
$9.99
Tags: Multiple choice question, MCQ, c++, cpp, object oriented programming, oop