Deck 18: Files and Streams

ملء الشاشة (f)
exit full mode
سؤال
The standard output stream object enables a program to output data to the
screen.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Console.In,Console.Out and Console.Error are used to take data in,to display data and to show error messages,respectively.
سؤال
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
سؤال
The Console.Error property returns:

A)a standard error stream object
B)a new error
C)an object of type error
D)None of the above
سؤال
Saving data to a file retains that data after the program terminates.
سؤال
Files can be stored in:

A)hard drives
B)optical disks
C)flash drives
D)All of the above
سؤال
Classes StreamIn and StreamOut are used to read from text files and output to text files.
سؤال
Characters in Visual Basic are Unicode characters,each represented by one byte.
سؤال
The smallest data item in a computer is the _________.

A)bit
B)byte
C)kilobyte
D)None of the above.
سؤال
One byte is composed of:

A)2 bits
B)4 bits
C)8 bits
D)10 bits
سؤال
A record is a group of fields and a file is a group of records.
سؤال
_______________ are used for long-term retention of large amounts of data.

A)Arrays
B)Buffers
C)Files
D)Data structures.
سؤال
Directory method GetDirectories returns _______.

A)a string with all the names of sibling directories
B)an array of strings with all the names of sibling directories
C)a string with all the names of subdirectories
D)an array of strings with all the names of subdirectories
سؤال
No matter how complicated a program is or looks it can all be broken down into a series of 0's and 1's.
سؤال
In a data hierarchy,data items become larger and more complex in structure as we progress from bits,to characters,to fields and up to large data structures.
سؤال
When a file is opened,a stream object is created and associated with the file.
سؤال
Data stored in arrays is permanent data.
سؤال
Visual Basic views every file simply as a sequential stream of bytes.
سؤال
To distinguish records,there has to be at least one field that is unique for each instance;this is called the record key.
سؤال
In a ____________ file,records are typically stored in order by a record-key field.

A)chronological
B)non-sequential
C)sequential
D)record-key
سؤال
Which of the following methods of FileStream will reset the file-position pointer back to the beginning of the file?

A)Reset
B)Origin
C)Seek
D)Beginning
سؤال
An OpenFileDialog allows a user to select a file to open.
سؤال
Visual Basic provides the class _______ for manipulating files.

A)Folder
B)FileUtil
C)File
D)FileManip
سؤال
The enumeration FileAccess is used to ________.

A)control future users' access to a file
B)control program access to a file
C)control the amount of updating that can be done on a file at once
D)FileAccess is a method,not an enumeration.
سؤال
Records in a sequential access file are always sorted by a record key
سؤال
To access a file,you must instantiate an object of type File.
سؤال
What kind of exception is thrown if there's a problem opening or creating a StreamWriter?

A)Exception
B)StreamException
C)OpenAndCreatingException
D)IOException
سؤال
Class File can only create new files.
سؤال
Which method creates a new file and returns a stream to process that file?

A)CreateFile method of class File
B)NewFile method of class File
C)Create method of class File
D)New method of class File
سؤال
Every file automatically closes itself when it's no longer needed.
سؤال
You can use the FileAccess enumeration to control access to
file when the file is opened.
سؤال
A FileStream object can throw a(n)________ if an attempt is made to open a file that does not exist.

A)NoFileException
B)FileNotFoundException
C)OpenErrorException
D)FileStreamException.
سؤال
A _____________ contains the byte number of the next byte in a file to be read or written to a file.

A)data locator
B)file counter
C)file-position pointer
D)byte-number counter.
سؤال
The classes dealing with files and directories are located in the System.IO namespace.
سؤال
Method GetFiles of Directory can be used to obtain a list of all the files in a given directory.
سؤال
What is the exception thrown when an error occurs during serialization or deserialization?

A)SerialException
B)DeserialException
C)SerializationException
D)DeserializationException
E)c and d,respectively
سؤال
Class Directory can be used to change directories.
سؤال
When a FileStream object is opened,the file-position pointer is _________.

A)set to Nothing
B)set to 0
C)needs to be explicitly created
D)set to the end of the file
سؤال
A serialized object is an object that includes ________.

A)a sequence of bytes about the object's data
B)information about the object's type
C)information about the types of data stored in the object
D)All of the above
سؤال
A StreamReader object must be created in order to retrieve data from a text file.
سؤال
BinaryFormatter allows for only reading objects.
سؤال
Which of the following attributes is needed to indicate to the CLR that objects of the class can be serialized?

A)
B)
C)
D)both a and b
سؤال
For variables of reference types,you must check the class declaration to ensure that the type is serializable.
سؤال
By default,array objects are not serializable.
سؤال
BinaryFormatter's Serialize and Deserialize methods are both parameterless.
سؤال
Another way that a class could indicate to the CLR that objects of the class can be serialized is through implementing the ________ interface.

A)Serializable
B)ISerializable
C)Serial
D)ISerial
سؤال
All primitive-type variables and strings are serializable.
سؤال
Method ________ of class BinaryFormatter reads a serialized object from a stream and reforms the object in memory.

A)Deserial
B)Deserialize
C)Deserializable
D)DSerial
سؤال
In a class that's marked with the <Serializable()> attribute or that implements interface ISerializable,not every instance variable of the class needs to be serializable.
سؤال
The name of the file to open is specified as the first argument to the FileStream constructor.
سؤال
Deserialize returns a reference of type:

A)Object which must be cast to the appropriate type to manipulate the object
B)the type that the object was originally
C)Deserialized which must be cast to the appropriate type to manipulate the object
D)None of the above
سؤال
An array is always serializable.
سؤال
BinaryFormatters can be used to serialize and deserialize objects coming in and going out of a stream.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/53
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 18: Files and Streams
1
The standard output stream object enables a program to output data to the
screen.
True
2
Console.In,Console.Out and Console.Error are used to take data in,to display data and to show error messages,respectively.
True
3
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
B
4
The Console.Error property returns:

A)a standard error stream object
B)a new error
C)an object of type error
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
5
Saving data to a file retains that data after the program terminates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
6
Files can be stored in:

A)hard drives
B)optical disks
C)flash drives
D)All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
7
Classes StreamIn and StreamOut are used to read from text files and output to text files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
8
Characters in Visual Basic are Unicode characters,each represented by one byte.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
9
The smallest data item in a computer is the _________.

A)bit
B)byte
C)kilobyte
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
10
One byte is composed of:

A)2 bits
B)4 bits
C)8 bits
D)10 bits
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
11
A record is a group of fields and a file is a group of records.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
12
_______________ are used for long-term retention of large amounts of data.

A)Arrays
B)Buffers
C)Files
D)Data structures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
13
Directory method GetDirectories returns _______.

A)a string with all the names of sibling directories
B)an array of strings with all the names of sibling directories
C)a string with all the names of subdirectories
D)an array of strings with all the names of subdirectories
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
14
No matter how complicated a program is or looks it can all be broken down into a series of 0's and 1's.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
15
In a data hierarchy,data items become larger and more complex in structure as we progress from bits,to characters,to fields and up to large data structures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
16
When a file is opened,a stream object is created and associated with the file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
17
Data stored in arrays is permanent data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
18
Visual Basic views every file simply as a sequential stream of bytes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
19
To distinguish records,there has to be at least one field that is unique for each instance;this is called the record key.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
20
In a ____________ file,records are typically stored in order by a record-key field.

A)chronological
B)non-sequential
C)sequential
D)record-key
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following methods of FileStream will reset the file-position pointer back to the beginning of the file?

A)Reset
B)Origin
C)Seek
D)Beginning
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
22
An OpenFileDialog allows a user to select a file to open.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
23
Visual Basic provides the class _______ for manipulating files.

A)Folder
B)FileUtil
C)File
D)FileManip
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
24
The enumeration FileAccess is used to ________.

A)control future users' access to a file
B)control program access to a file
C)control the amount of updating that can be done on a file at once
D)FileAccess is a method,not an enumeration.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
25
Records in a sequential access file are always sorted by a record key
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
26
To access a file,you must instantiate an object of type File.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
27
What kind of exception is thrown if there's a problem opening or creating a StreamWriter?

A)Exception
B)StreamException
C)OpenAndCreatingException
D)IOException
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
28
Class File can only create new files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
29
Which method creates a new file and returns a stream to process that file?

A)CreateFile method of class File
B)NewFile method of class File
C)Create method of class File
D)New method of class File
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
30
Every file automatically closes itself when it's no longer needed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
31
You can use the FileAccess enumeration to control access to
file when the file is opened.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
32
A FileStream object can throw a(n)________ if an attempt is made to open a file that does not exist.

A)NoFileException
B)FileNotFoundException
C)OpenErrorException
D)FileStreamException.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
33
A _____________ contains the byte number of the next byte in a file to be read or written to a file.

A)data locator
B)file counter
C)file-position pointer
D)byte-number counter.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
34
The classes dealing with files and directories are located in the System.IO namespace.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
35
Method GetFiles of Directory can be used to obtain a list of all the files in a given directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
36
What is the exception thrown when an error occurs during serialization or deserialization?

A)SerialException
B)DeserialException
C)SerializationException
D)DeserializationException
E)c and d,respectively
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
37
Class Directory can be used to change directories.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
38
When a FileStream object is opened,the file-position pointer is _________.

A)set to Nothing
B)set to 0
C)needs to be explicitly created
D)set to the end of the file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
39
A serialized object is an object that includes ________.

A)a sequence of bytes about the object's data
B)information about the object's type
C)information about the types of data stored in the object
D)All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
40
A StreamReader object must be created in order to retrieve data from a text file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
41
BinaryFormatter allows for only reading objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
42
Which of the following attributes is needed to indicate to the CLR that objects of the class can be serialized?

A)
B)
C)
D)both a and b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
43
For variables of reference types,you must check the class declaration to ensure that the type is serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
44
By default,array objects are not serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
45
BinaryFormatter's Serialize and Deserialize methods are both parameterless.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
46
Another way that a class could indicate to the CLR that objects of the class can be serialized is through implementing the ________ interface.

A)Serializable
B)ISerializable
C)Serial
D)ISerial
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
47
All primitive-type variables and strings are serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
48
Method ________ of class BinaryFormatter reads a serialized object from a stream and reforms the object in memory.

A)Deserial
B)Deserialize
C)Deserializable
D)DSerial
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
49
In a class that's marked with the <Serializable()> attribute or that implements interface ISerializable,not every instance variable of the class needs to be serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
50
The name of the file to open is specified as the first argument to the FileStream constructor.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
51
Deserialize returns a reference of type:

A)Object which must be cast to the appropriate type to manipulate the object
B)the type that the object was originally
C)Deserialized which must be cast to the appropriate type to manipulate the object
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
52
An array is always serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
53
BinaryFormatters can be used to serialize and deserialize objects coming in and going out of a stream.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.