Deck 8: Files and Streams
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
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/35
Play
Full screen (f)
Deck 8: Files and Streams
1
The __________ namespace contains stream classes such as StreamWriter and StreamReader.
A)System.IO
B)System.ReadWrite
C)System.InputOutput
D)System.
A)System.IO
B)System.ReadWrite
C)System.InputOutput
D)System.
A
2
Data stored in a file is considered:
A)temporary data
B)persistent data
C)recurring data
D)there is no need to store data in files
A)temporary data
B)persistent data
C)recurring data
D)there is no need to store data in files
B
3
Framework Class Library classes are grouped by functionality into__________.
A)namegroups
B)namepanels
C)namespaces
D)namecollections
A)namegroups
B)namepanels
C)namespaces
D)namecollections
C
4
In a ____________ file,records are typically stored in order by a record-key field.
A)chronological
B)non-sequential
C)sequential
D)record-key
A)chronological
B)non-sequential
C)sequential
D)record-key
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
5
_______________ are used for long-term retention of large amounts of data.
A)Memory cards
B)Buffers
C)Files
D)Data structures.
A)Memory cards
B)Buffers
C)Files
D)Data structures.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
6
The Using statement indicates that you're using classes from a particular namespace.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
7
Files can only be stored on a computer's hard drive.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
8
Computer circuitry is able to:
A)get the value of a bit
B)examine the value of a bit
C)reverse the value of a bit
D)All of the above
A)get the value of a bit
B)examine the value of a bit
C)reverse the value of a bit
D)All of the above
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
9
Data stored in arrays is permanent data.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
10
No matter how complicated a program is or looks it can all be broken down into a series of 0's and 1's.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
11
A field is a random group of characters.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
12
ToolStripMenuItem controls are used to create __________ and menu items.
A)tools
B)strips
C)toolbars
D)menus
A)tools
B)strips
C)toolbars
D)menus
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
13
One byte is composed of:
A)2 bits
B)4 bits
C)8 bits
D)10 bits
A)2 bits
B)4 bits
C)8 bits
D)10 bits
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
14
The __________ control enables you to place a menu bar in your window.
A)MenuTool
B)MenuBar
C)MenuStrip
D)None of the above
A)MenuTool
B)MenuBar
C)MenuStrip
D)None of the above
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
15
An example of when a file should not be used is:
A)to save the status of a video game for another session.
B)to save the value of a variable at runtime.
C)to log errors in the execution of a program.
D)these are all good examples of when files should be used.
A)to save the status of a video game for another session.
B)to save the value of a variable at runtime.
C)to log errors in the execution of a program.
D)these are all good examples of when files should be used.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
16
Binary code is actually:
A)a complex programming language.
B)a series of 0's and 1's.
C)machine language instructions.
D)a series of characters representing the numbers 0 to 9
A)a complex programming language.
B)a series of 0's and 1's.
C)machine language instructions.
D)a series of characters representing the numbers 0 to 9
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
17
The smallest data item in a computer is the _________.
A)bit
B)byte
C)kilobyte
D)None of the above.
A)bit
B)byte
C)kilobyte
D)None of the above.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
18
To distinguish records,there has to be one field that's unique for each instance;this is called the record key.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
19
Visual Basic views every file simply as a sequential stream of bytes.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
20
File-processing capabilities are important for a programming language to
support commercial apps.
support commercial apps.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
21
The ___________ block is an ideal location in which to place resource release code for resources such as files that are acquired and manipulated in the corresponding Try block.
A)Catch
B)Release
C)Finally
D)Return
A)Catch
B)Release
C)Finally
D)Return
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
22
Objects which represent resources that should be returned to the system typically provide a __________ method that must be called to return the resources.
A)Release
B)Dispose
C)Return
D)Free
A)Release
B)Dispose
C)Return
D)Free
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
23
SaveFileDialog property__________ returns the location and name of the selected file.
A)PathName
B)LocationName
C)FileDirectory
D)FileName
A)PathName
B)LocationName
C)FileDirectory
D)FileName
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
24
Most file processing operations have the potential to throw __________,so such operations are typically placed in Try statements.
A)FileExceptions
B)ReadWriteExceptions
C)InputOutputExceptions
D)IOExceptions
A)FileExceptions
B)ReadWriteExceptions
C)InputOutputExceptions
D)IOExceptions
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
25
String method Split returns a __________ array representing the tokens.
A)Text
B)Delimiter
C)Token
D)String
A)Text
B)Delimiter
C)Token
D)String
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
26
StreamWriter method __________ closes the stream and the corresponding file.
A)StreamClose
B)TerminateIO
C)FileClose
D)Close
A)StreamClose
B)TerminateIO
C)FileClose
D)Close
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
27
The __________ statement is a shorthand notation for a Try statement with a Finally block.
A)Import
B)Utilizing
C)TryFinally
D)Using
A)Import
B)Utilizing
C)TryFinally
D)Using
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
28
The optional Finally block-if present-executes only when an exception occurs in the corresponding Try block.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
29
The Using statement simplifies writing code in which you __________ a resource.
A)release
B)obtain
C)use
D)All of the above
A)release
B)obtain
C)use
D)All of the above
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
30
Like Buttons,menu items have __________ events that notify the program when an item is selected.
A)Select
B)Hover
C)Choose
D)Click
A)Select
B)Hover
C)Choose
D)Click
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
31
StreamWriter method __________ writes a sequence of characters to a file and positions the output cursor to the beginning of the next line in the file.
A)WriteLine
B)NewLine
C)NextLine
D)WriteMoveCursor
A)WriteLine
B)NewLine
C)NextLine
D)WriteMoveCursor
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
32
Local variables in a Try block cannot be accessed in the corresponding Finally block.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
33
To specify the shortcut key for a menu or menu item,type a __________ before the character to be underlined in the menu or menu item's name.
A)%
B)*
C)&
D)#
A)%
B)*
C)&
D)#
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
34
Namespace System must be imported into a program to use the classes in that namespace.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
35
StreamReader property EndOfStream returns True if the end of the file has been reached.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck