The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 337 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
170c C++ need help
(TCO 13) Files that are accessed in consecutive order are known as _____. (Points : 3)
sequential files
random access files
binary files
consecutive files
Question 2.
2. (TCO 13) In terms of storage and retrieval of data, sequential access files are similar to _____.(Points : 3)
floppy disks
books
hard disks
cassette tapes
Question 3.
3. (TCO 13) Once you finish using a file, you should _____ it. (Points : 3)
exit
append
close
output
Question 4.
4. (TCO 13) The header file that defines the classes for processing and manipulating files is called the _____. (Points : 3)
<iostream>
<fstream>
<pstream>
<mstream>
Question 5.
5. (TCO 13) What do the following statements accomplish?
ofstream theFile;
theFile.open( myFile.txt , ios::app); (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
Question 6.
6. (TCO 13) Which class is used to read data from a text file? (Points : 3)
ifstream
readstream
readme
None of the above
Question 7.
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
Question 8.
8. (TCO 13) What is the data hierarchy arranged from smallest to largest? (Points : 3)
Bit, byte, record, field, file
Byte, bit, field, record, file
Bit, byte, field, record, file
Byte, bit, field, file, record
Question 9.
9. (TCO 13) To use an input file, the program must include _____. (Points : 3)
fstream
instream
outstream
filestream
Question 10.
10. (TCO 13) Which of the following is not true about files? (Points : 3)
C++ views each file as a sequential stream of bytes.
Files are opened by creating objects of stream classes.
Member functions of stream objects can be applied to file streams.
istream, ostream, and iostream are derived from ifstream, ofstream, and fstream, respectively.
Question 11.
11. (TCO 13) Explain how the end-of-file method is used when reading data from a sequential file. Provide a C++ code segment that reads data from a text file using a while loop. (Points : 5)
----------- ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly