Deck 8: Sequential-Access Files

ملء الشاشة (f)
exit full mode
سؤال
In order to perform file processing in C++, which header files must be included?

A) , and .
B) and .
C) and .
D) and .
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
When used with ofstream objects, operator! is not:

A) Overloaded.
B) Used to determine if the open operation succeeded.
C) Used to close a file explicitly.
D) Used to return a nonzero value if an error occurs.
سؤال
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.
سؤال
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
سؤال
Typically, which of the following contains the most data?

A) A database.
B) A file.
C) A byte.
D) A field.
سؤال
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.
سؤال
Select the false statement.

A) C++ imposes no structure on a file.
B) C++ files include information about their structure.
C) The programmer must impose a structure on a file.
D) C++ files do not understand notions such as "records" and "fields."
سؤال
What is not true about this code segment?
Location = fileObject.tellg);

A) tellg is a member function of fileObject.
B) location is a pointer.
C) The value of location after the segment executes must be less than or equal to the number of bytes in the file attached to fileObject.
D) fileObject is an istream object.
سؤال
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.
سؤال
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 );
سؤال
Which statement is not true about 0, z , %, * and Q?

A) Each can be represented in terms of 0s and 1s.
B) Each is a character.
C) Only three of the elements listed are in typical character sets.
D) Each can be represented as a byte.
سؤال
Select the false statement.

A) All data items can eventually be reduced to a sequence of 0s and 1s.
B) A binary digit bit) can store two values simultaneously.
C) It is cumbersome to work with data in bit form.
D) It is easiest to produce electronic devices that can assume one of two stable states.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/12
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 8: Sequential-Access Files
1
In order to perform file processing in C++, which header files must be included?

A) , and .
B) and .
C) and .
D) and .
D
2
When used with ofstream objects, operator! is not:

A) Overloaded.
B) Used to determine if the open operation succeeded.
C) Used to close a file explicitly.
D) Used to return a nonzero value if an error occurs.
C
3
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.
C
4
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
5
Typically, which of the following contains the most data?

A) A database.
B) A file.
C) A byte.
D) A field.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
6
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
7
Select the false statement.

A) C++ imposes no structure on a file.
B) C++ files include information about their structure.
C) The programmer must impose a structure on a file.
D) C++ files do not understand notions such as "records" and "fields."
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
8
What is not true about this code segment?
Location = fileObject.tellg);

A) tellg is a member function of fileObject.
B) location is a pointer.
C) The value of location after the segment executes must be less than or equal to the number of bytes in the file attached to fileObject.
D) fileObject is an istream object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
9
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
10
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 );
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which statement is not true about 0, z , %, * and Q?

A) Each can be represented in terms of 0s and 1s.
B) Each is a character.
C) Only three of the elements listed are in typical character sets.
D) Each can be represented as a byte.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
12
Select the false statement.

A) All data items can eventually be reduced to a sequence of 0s and 1s.
B) A binary digit bit) can store two values simultaneously.
C) It is cumbersome to work with data in bit form.
D) It is easiest to produce electronic devices that can assume one of two stable states.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.