Exam 14: Files and Streams
Exam 1: A First Program Using C42 Questions
Exam 2: Using Data42 Questions
Exam 3: Using Gui Objects and the Visual Studio Ide42 Questions
Exam 4: Making Decisions42 Questions
Exam 5: Looping42 Questions
Exam 6: Using Arrays42 Questions
Exam 7: Using Methods42 Questions
Exam 8: Advanced Method Concepts42 Questions
Exam 9: Using Classes and Objects42 Questions
Exam 10: Introduction to Inheritance42 Questions
Exam 11: Exception Handling42 Questions
Exam 12: Using Controls42 Questions
Exam 13: Handling Events41 Questions
Exam 14: Files and Streams42 Questions
Select questions type
Files that store music or images are in ____ format.
Free
(Multiple Choice)
4.9/5
(42)
Correct Answer:
B
The FileStream class has 15 overloaded constructors. What can you tell about the FileStream object named myFile , given the constructor below?
FileStream myFile =
new FileStream("SomeText.txt"), FileMode.Create,
FileAccess.Write);
Free
(Essay)
4.7/5
(36)
Correct Answer:
In this example, the filename is "SomeText.txt". Because no path is indicated, the file is assumed to be in the current directory. The mode is Create , which means a new file will be created even if one with the same name already exists. The access is Write , which means you can write data to the file but you cannot read from it.
When you produce screen output and accept keyboard input, you use the Console class, which provides access to which three standard streams?
Free
(Essay)
4.7/5
(47)
Correct Answer:
* Console.In refers to the standard input stream object, which accepts data from the keyboard.
* Console.Out refers to the standard output stream object, which allows a program to produce output on the screen.
* Console.Error refers to the standard error stream object, which allows a program to write error messages to the screen.
Sometimes it is necessary to process a sequential text file multiple times from the beginning during a program's execution. After the file is processed the first time, the file pointer is at the end of the file. How can you reread the file at this point?
(Essay)
4.8/5
(48)
Most computer users organize their files into ____ or directories.
(Multiple Choice)
4.7/5
(39)
A data file is a ____ access file when each record is read in order of its position in the file.
(Multiple Choice)
4.8/5
(36)
What are the disadvantages to writing data to a text file using tokens and delimiters as opposed to writing an entire object to a file at once?
(Essay)
4.8/5
(35)
When you store data in a computer file on a persistent storage device, you ____.
(Multiple Choice)
4.8/5
(41)
Using a ____ in your programs refers to the bad programming practice of hardcoding numbers (unnamed, literal constants) in code without explanation.
(Multiple Choice)
4.9/5
(39)
Because you can erase data from files, some programmers prefer the term ____ storage to permanent storage.
(Multiple Choice)
4.9/5
(46)
A program that reads from a sequential access data file creates a FileStream object, and then the FileStream object is passed to a StreamReader object's constructor. Once this has been done, the ReadLine() method can be used to retrieve one line at a time from the data file. Show the sequence of instructions that would create the FileStream and StreamReader needed to access a data file, and then read one line from the file.
(Essay)
5.0/5
(30)
Files exist on ____ storage devices, such as hard disks, USB drives, reels of magnetic tape, and optical discs.
(Multiple Choice)
4.9/5
(39)
The terms directory and folder are used synonymously to refer to an entity that is used to organize files.
(True/False)
4.8/5
(32)
Write a program that prompts a user for a filename and tests the file's existence. If the file exists, display the file creation time. If it does not exist, display a message.
(Essay)
4.8/5
(40)
____ is the process of converting objects into streams of bytes.
(Multiple Choice)
4.7/5
(33)
A file's ____ holds the byte number of the next byte to be read.
(Multiple Choice)
4.7/5
(47)
Showing 1 - 20 of 42
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)