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: | 313 Weeks Ago, 5 Days 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