Deck 22: Im Saving for the Future Sequential Access Files
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 22: Im Saving for the Future Sequential Access Files
1
After declaring a StreamReader variable, you can use the ____ method to open a sequential access file for input, which automatically creates a StreamReader object.
A) ReadText
C) GetText
B) InputText
D) OpenText
A) ReadText
C) GetText
B) InputText
D) OpenText
D
2
An item of data-such as the string "Yolanda"-is viewed similarly by a human being and a computer.
False
3
The ReadLine method requires you to provide the file's name.
False
4
In Visual Basic, you use a ____ object to write a stream of characters to a sequential access file.
A) StreamReader
C) StreamWriter
B) StreamWriteObject
D) StreamReadWriteObject
A) StreamReader
C) StreamWriter
B) StreamWriteObject
D) StreamReadWriteObject
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
In most cases, you assign the string returned by the ReadLine method to a String variable.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
The "doc" filename extension is commonly used when naming sequential access files.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
When you are writing data to a file, in most cases you will use the Write method.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
The syntax to close a sequential access file associated with a StreamWriter object is ____.
A) streamWriterVariableName.Close()
B) streamWriterVariableName.FileClose()
C) streamWriterVariableName.CloseFile()
D) Close.streamWriterVariableName(data)
A) streamWriterVariableName.Close()
B) streamWriterVariableName.FileClose()
C) streamWriterVariableName.CloseFile()
D) Close.streamWriterVariableName(data)
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
Programmers refer to a sequence of characters as a(n) ____.
A) array stream
C) flow
B) bytestream
D) stream of characters
A) array stream
C) flow
B) bytestream
D) stream of characters
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
After creating the StreamReader object, you declare a variable to store the object in the computer's internal memory.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
Before you create a StreamWriter object, you first declare a variable to store the object in the computer's internal memory.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
In most cases, an application will need to read each line of text contained in a sequential access file, one line at a time.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
Most input and output files are composed of lines of text that are both read and written sequentially.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
The ReadLine method returns a string that contains the sequence of characters in the current line, including the newline character at the end of the line.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
Files that are read by the computer are called ____ files.
A) output
C) writeOnly
B) readOnly
D) input
A) output
C) writeOnly
B) readOnly
D) input
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
In addition to getting data from the keyboard and sending data to the computer screen, an application can also get data from and send data to a file on a disk.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
The syntax for declaring a streamwriter variable is ____.
A) [Dim | Private] streamWriterVariableName As IO.StreamWriter
B) {Dim | Private} streamWriterVariableName As IO.StreamWriter
C) {Dim | Private} streamWriterVariableName As IO.StreamWriteObject
D) Private streamWriterVariableName As IO.StreamWriter
A) [Dim | Private] streamWriterVariableName As IO.StreamWriter
B) {Dim | Private} streamWriterVariableName As IO.StreamWriter
C) {Dim | Private} streamWriterVariableName As IO.StreamWriteObject
D) Private streamWriterVariableName As IO.StreamWriter
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
You can use the Exists method to avoid the run time error that occurs when the computer cannot locate the file you want opened for input.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
Most input and output files are referred to as ____ files.
A) sequential access
C) any access
B) random access
D) serial access
A) sequential access
C) any access
B) random access
D) serial access
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
Files to which data is written are called ____ files.
A) input
C) writeOnly
B) output
D) readOnly
A) input
C) writeOnly
B) output
D) readOnly
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
The ____ method returns the Boolean value True if the file exists; otherwise, it returns the Boolean value False.
A) IsThere
C) DoesExist
B) CanFind
D) Exists
A) IsThere
C) DoesExist
B) CanFind
D) Exists
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
A ____ is defined as a sequence (stream) of characters followed by the newline character.
A) line
C) column
B) row
D) string
A) line
C) column
B) row
D) string
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
The syntax for determining whether a sequential access file exists is ____.
A) IO.Exists(fileName)
C) IO.File.Exists(fileName)
B) IO.(fileName).Exists()
D) IO.File(fileName).Exists
A) IO.Exists(fileName)
C) IO.File.Exists(fileName)
B) IO.(fileName).Exists()
D) IO.File(fileName).Exists
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
The ____ method can be used to read a file's contents, one line at a time.
A) Read
C) ReadInputLine
B) ReadLine
D) ReadInput
A) Read
C) ReadInputLine
B) ReadLine
D) ReadInput
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
The syntax of the Peek method is ____.
A) streamReaderVariableName.Peekaboo
B) Peek.streamReaderVariableName
C) streamReaderVariableName.Peek
D) Peek(streamReaderVariableName)
A) streamReaderVariableName.Peekaboo
B) Peek.streamReaderVariableName
C) streamReaderVariableName.Peek
D) Peek(streamReaderVariableName)
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck