Professional Documents
Culture Documents
Test Bank For C How To Program Late Objects Version 7 e 7th Edition 0132165414 Download
Test Bank For C How To Program Late Objects Version 7 e 7th Edition 0132165414 Download
8.2 Q3: The data hierarchy, arranged from smallest to largest, is:
a. Bit, byte, record, field, file.
b. Byte, bit, field, record, file.
c. Bit, byte, field, record, file.
d. Byte, bit, field, file, record.
ANS c. Bit, byte, field, record, file.
8.2 Q4: Typically, which of the following contains the most data?
a. A database.
b. A file.
c. A byte.
d. A field.
ANS a. A database.
8.3 Q1: Which of the following does not have a stream associated with it?
a. cerr.
b. cin.
c. cout.
d. All of the above have streams associated with them.
ANS c. All of the above have streams associated with them.
8.3 Q2: In order to perform file processing in C++, which header files must be included?
a. <cstdio> , <iostream> and <fstream>.
b. <cstdio> and <iostream>.
c. <cstdio> and <fstream>.
d. <iostream> and <fstream>.
ANS d. <iostream> and <fstream>.
© Copyright 1992-2011 by Deitel & Associates, Inc. and Pearson Education, Inc. All Rights Reserved.
Test Bank for C++ How to Program: Late Objects Version, 7/E 7th Edition : 0132165414
8.4 Q2: Which file open mode would be used to write data only to the end of an existing file?
a. ios::app
b. ios::in
c. ios::out
d. ios::trunc
ANS a. ios::app
8.5 Q1: Which of the following will not change the file-position pointer to the same position as the others? Assume
a 10-byte file size and a current position at byte # 1.
a. fileObject.seekg( 2 );
b. fileObject.seekg( 1, ios::cur );
c. fileObject.seekg( 2, ios::beg );
d. fileObject.seekg( 8, ios::end );
ANS d. fileObject.seekg( 8, ios::end );
location = fileObject.tellg();
8.6 Q1: Which of the following is not a disadvantage of trying to modify a sequential access file?
a. Modifying data can potentially destroy other data.
b. It may be necessary to rewrite every record in the file to make a slight change.
c. Things that are stored in the same number of “raw data” bytes internally may not take up the same amount
of space in a file.
d. Overwriting a record with another record of the same size is very difficult.
ANS: d. Overwriting a record with another record of the same size is very difficult.
© Copyright 1992-2011 by Deitel & Associates, Inc. and Pearson Education, Inc. All Rights Reserved.