Deck 14: Files and Streams

ملء الشاشة (f)
exit full mode
سؤال
The ____ class provides you with information about directories or folders.

A) Directory
B) File
C) Cabinet
D) Folder
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
A ____ is a collection of fields that contain data about an entity.

A) file
B) character
C) record
D) bit
سؤال
The File class is contained in the System.IOFile namespace.
سؤال
When you copy data from a file on a storage device into RAM, you ____.

A) write to the file
B) read from the file
C) copy to the file
D) do not use streams
سؤال
Most computer users organize their files into ____ or directories.

A) folders
B) bins
C) buckets
D) drawers
سؤال
The ____ class contains methods that allow you to access information about files.

A) Cabinet
B) File
C) Directory
D) Folder
سؤال
A CSV file contains values separated by semicolon delimiters.
سؤال
A C# application ____ by creating an object and associating a stream of bytes with that object.

A) returns a file
B) closes a file
C) opens a file
D) removes a file
سؤال
A data file is a ____ access file when each record is read in order of its position in the file.

A) sequential
B) random
C) dynamic
D) temporary
سؤال
Files exist on ____ storage devices, such as hard disks, USB drives, reels of magnetic tape, and optical discs.

A) temporary
B) volatile
C) soft
D) permanent
سؤال
When you store data in a computer file on a persistent storage device, you ____.

A) read from the file
B) use an input stream
C) write to the file
D) erase data from memory
سؤال
When you write a program and save it to a disk, you are using temporary storage.
سؤال
When a C# application ____, the file is no longer available to the application.

A) opens a file
B) returns a file
C) writes to a file
D) closes a file
سؤال
Because you can erase data from files, some programmers prefer the term ____ storage to permanent storage.

A) volatile
B) temporary
C) transit
D) persistent
سؤال
Files that store music or images are in ____ format.

A) data
B) binary
C) text
D) information
سؤال
A ____ is any one of the letters, numbers, or other special symbols (such as punctuation marks) that comprise data.

A) field
B) record
C) delimiter
D) character
سؤال
When data values in a program are stored in memory, they are lost when the program ends.
سؤال
The terms directory and folder are used synonymously to refer to an entity that is used to organize files.
سؤال
Permanent storage is ____.

A) volatile
B) temporal
C) nonvolatile
D) soft storage
سؤال
When you write a C# program that stores a value in a variable, you are using temporary storage; the value you store is lost when the program ends or the computer loses power. This type of storage is ____.

A) volatile
B) nonvolatile
C) permanent
D) hard
سؤال
Using a ____ in your programs refers to the bad programming practice of hardcoding numbers (unnamed, literal constants) in code without explanation.

A) constant
B) token
C) magic number
D) character set
سؤال
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);
سؤال
____ is the process of converting objects into streams of bytes.

A) Deserialization
B) Normalization
C) Streaming
D) Serialization
سؤال
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.
سؤال
Temporary storage is usually called computer memory or _________________________.
سؤال
What is a character?
سؤال
Some files are ____________________ that contain facts and figures, such as a payroll file that contains employee numbers, names, and salaries.
سؤال
A file's ____ holds the byte number of the next byte to be read.

A) token
B) file position pointer
C) magic number
D) record token
سؤال
The ____ method is a member of the String class; it takes a character delimiter parameter and separates a string into substrings at each occurrence of the delimiter.

A) Separate()
B) Split()
C) Delimit()
D) Substring()
سؤال
The set of all the characters used to represent data on a particular computer is that computer's ____________________.
سؤال
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.
سؤال
When you produce screen output and accept keyboard input, you use the Console class, which provides access to which three standard streams?
سؤال
When you perform an input operation in an application, you can picture bytes flowing into your program from an input device through a ____, which functions as a pipeline or channel.

A) directory
B) stream
C) root
D) path
سؤال
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?
سؤال
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?
سؤال
Describe some of the methods of the Directory class.
سؤال
____ converts streams of bytes back into objects.

A) Deserialization
B) Serialization
C) Normalization
D) Denormalization
سؤال
What is a record?
سؤال
Tossing a file into a drawer of a file cabinet without a folder is the equivalent of placing a file in the main or ____________________ of your storage device when storing computer files.
سؤال
Businesses store data in a relationship known as the data ____________________.
سؤال
Match between columns
Store music, images, and executable programs
binary files
Store music, images, and executable programs
permanent storage
Store music, images, and executable programs
token
Store music, images, and executable programs
delimiter
Store music, images, and executable programs
field
Store music, images, and executable programs
computer file
Store music, images, and executable programs
path
Store music, images, and executable programs
random access file
Store music, images, and executable programs
key field
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
binary files
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
permanent storage
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
token
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
delimiter
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
field
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
computer file
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
path
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
random access file
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
key field
A character or group of characters that has some meaning
binary files
A character or group of characters that has some meaning
permanent storage
A character or group of characters that has some meaning
token
A character or group of characters that has some meaning
delimiter
A character or group of characters that has some meaning
field
A character or group of characters that has some meaning
computer file
A character or group of characters that has some meaning
path
A character or group of characters that has some meaning
random access file
A character or group of characters that has some meaning
key field
A file in which records are not used in sequence
binary files
A file in which records are not used in sequence
permanent storage
A file in which records are not used in sequence
token
A file in which records are not used in sequence
delimiter
A file in which records are not used in sequence
field
A file in which records are not used in sequence
computer file
A file in which records are not used in sequence
path
A file in which records are not used in sequence
random access file
A file in which records are not used in sequence
key field
A collection of information stored on a nonvolatile device in a computer system
binary files
A collection of information stored on a nonvolatile device in a computer system
permanent storage
A collection of information stored on a nonvolatile device in a computer system
token
A collection of information stored on a nonvolatile device in a computer system
delimiter
A collection of information stored on a nonvolatile device in a computer system
field
A collection of information stored on a nonvolatile device in a computer system
computer file
A collection of information stored on a nonvolatile device in a computer system
path
A collection of information stored on a nonvolatile device in a computer system
random access file
A collection of information stored on a nonvolatile device in a computer system
key field
A field used to uniquely identify each record in a sequential file
binary files
A field used to uniquely identify each record in a sequential file
permanent storage
A field used to uniquely identify each record in a sequential file
token
A field used to uniquely identify each record in a sequential file
delimiter
A field used to uniquely identify each record in a sequential file
field
A field used to uniquely identify each record in a sequential file
computer file
A field used to uniquely identify each record in a sequential file
path
A field used to uniquely identify each record in a sequential file
random access file
A field used to uniquely identify each record in a sequential file
key field
A character used to specify the boundary between data items in text files
binary files
A character used to specify the boundary between data items in text files
permanent storage
A character used to specify the boundary between data items in text files
token
A character used to specify the boundary between data items in text files
delimiter
A character used to specify the boundary between data items in text files
field
A character used to specify the boundary between data items in text files
computer file
A character used to specify the boundary between data items in text files
path
A character used to specify the boundary between data items in text files
random access file
A character used to specify the boundary between data items in text files
key field
Is not lost when a computer loses power
binary files
Is not lost when a computer loses power
permanent storage
Is not lost when a computer loses power
token
Is not lost when a computer loses power
delimiter
Is not lost when a computer loses power
field
Is not lost when a computer loses power
computer file
Is not lost when a computer loses power
path
Is not lost when a computer loses power
random access file
Is not lost when a computer loses power
key field
A block of text within a string that represents an entity or a field
binary files
A block of text within a string that represents an entity or a field
permanent storage
A block of text within a string that represents an entity or a field
token
A block of text within a string that represents an entity or a field
delimiter
A block of text within a string that represents an entity or a field
field
A block of text within a string that represents an entity or a field
computer file
A block of text within a string that represents an entity or a field
path
A block of text within a string that represents an entity or a field
random access file
A block of text within a string that represents an entity or a field
key field
سؤال
How can you create a class whose objects can be written to and read from data files? Show an example.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/42
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 14: Files and Streams
1
The ____ class provides you with information about directories or folders.

A) Directory
B) File
C) Cabinet
D) Folder
A
2
A ____ is a collection of fields that contain data about an entity.

A) file
B) character
C) record
D) bit
C
3
The File class is contained in the System.IOFile namespace.
False
4
When you copy data from a file on a storage device into RAM, you ____.

A) write to the file
B) read from the file
C) copy to the file
D) do not use streams
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
5
Most computer users organize their files into ____ or directories.

A) folders
B) bins
C) buckets
D) drawers
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
6
The ____ class contains methods that allow you to access information about files.

A) Cabinet
B) File
C) Directory
D) Folder
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
7
A CSV file contains values separated by semicolon delimiters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
8
A C# application ____ by creating an object and associating a stream of bytes with that object.

A) returns a file
B) closes a file
C) opens a file
D) removes a file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
9
A data file is a ____ access file when each record is read in order of its position in the file.

A) sequential
B) random
C) dynamic
D) temporary
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
10
Files exist on ____ storage devices, such as hard disks, USB drives, reels of magnetic tape, and optical discs.

A) temporary
B) volatile
C) soft
D) permanent
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
11
When you store data in a computer file on a persistent storage device, you ____.

A) read from the file
B) use an input stream
C) write to the file
D) erase data from memory
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
12
When you write a program and save it to a disk, you are using temporary storage.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
13
When a C# application ____, the file is no longer available to the application.

A) opens a file
B) returns a file
C) writes to a file
D) closes a file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
14
Because you can erase data from files, some programmers prefer the term ____ storage to permanent storage.

A) volatile
B) temporary
C) transit
D) persistent
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
15
Files that store music or images are in ____ format.

A) data
B) binary
C) text
D) information
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
16
A ____ is any one of the letters, numbers, or other special symbols (such as punctuation marks) that comprise data.

A) field
B) record
C) delimiter
D) character
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
17
When data values in a program are stored in memory, they are lost when the program ends.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
18
The terms directory and folder are used synonymously to refer to an entity that is used to organize files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
19
Permanent storage is ____.

A) volatile
B) temporal
C) nonvolatile
D) soft storage
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
20
When you write a C# program that stores a value in a variable, you are using temporary storage; the value you store is lost when the program ends or the computer loses power. This type of storage is ____.

A) volatile
B) nonvolatile
C) permanent
D) hard
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
21
Using a ____ in your programs refers to the bad programming practice of hardcoding numbers (unnamed, literal constants) in code without explanation.

A) constant
B) token
C) magic number
D) character set
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
22
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);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
23
____ is the process of converting objects into streams of bytes.

A) Deserialization
B) Normalization
C) Streaming
D) Serialization
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
24
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
25
Temporary storage is usually called computer memory or _________________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
26
What is a character?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
27
Some files are ____________________ that contain facts and figures, such as a payroll file that contains employee numbers, names, and salaries.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
28
A file's ____ holds the byte number of the next byte to be read.

A) token
B) file position pointer
C) magic number
D) record token
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
29
The ____ method is a member of the String class; it takes a character delimiter parameter and separates a string into substrings at each occurrence of the delimiter.

A) Separate()
B) Split()
C) Delimit()
D) Substring()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
30
The set of all the characters used to represent data on a particular computer is that computer's ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
31
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
32
When you produce screen output and accept keyboard input, you use the Console class, which provides access to which three standard streams?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
33
When you perform an input operation in an application, you can picture bytes flowing into your program from an input device through a ____, which functions as a pipeline or channel.

A) directory
B) stream
C) root
D) path
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
34
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?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
35
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?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
36
Describe some of the methods of the Directory class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
37
____ converts streams of bytes back into objects.

A) Deserialization
B) Serialization
C) Normalization
D) Denormalization
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
38
What is a record?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
39
Tossing a file into a drawer of a file cabinet without a folder is the equivalent of placing a file in the main or ____________________ of your storage device when storing computer files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
40
Businesses store data in a relationship known as the data ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
41
Match between columns
Store music, images, and executable programs
binary files
Store music, images, and executable programs
permanent storage
Store music, images, and executable programs
token
Store music, images, and executable programs
delimiter
Store music, images, and executable programs
field
Store music, images, and executable programs
computer file
Store music, images, and executable programs
path
Store music, images, and executable programs
random access file
Store music, images, and executable programs
key field
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
binary files
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
permanent storage
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
token
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
delimiter
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
field
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
computer file
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
path
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
random access file
The combination of the disk drive plus the complete hierarchy of directories in which a file resides
key field
A character or group of characters that has some meaning
binary files
A character or group of characters that has some meaning
permanent storage
A character or group of characters that has some meaning
token
A character or group of characters that has some meaning
delimiter
A character or group of characters that has some meaning
field
A character or group of characters that has some meaning
computer file
A character or group of characters that has some meaning
path
A character or group of characters that has some meaning
random access file
A character or group of characters that has some meaning
key field
A file in which records are not used in sequence
binary files
A file in which records are not used in sequence
permanent storage
A file in which records are not used in sequence
token
A file in which records are not used in sequence
delimiter
A file in which records are not used in sequence
field
A file in which records are not used in sequence
computer file
A file in which records are not used in sequence
path
A file in which records are not used in sequence
random access file
A file in which records are not used in sequence
key field
A collection of information stored on a nonvolatile device in a computer system
binary files
A collection of information stored on a nonvolatile device in a computer system
permanent storage
A collection of information stored on a nonvolatile device in a computer system
token
A collection of information stored on a nonvolatile device in a computer system
delimiter
A collection of information stored on a nonvolatile device in a computer system
field
A collection of information stored on a nonvolatile device in a computer system
computer file
A collection of information stored on a nonvolatile device in a computer system
path
A collection of information stored on a nonvolatile device in a computer system
random access file
A collection of information stored on a nonvolatile device in a computer system
key field
A field used to uniquely identify each record in a sequential file
binary files
A field used to uniquely identify each record in a sequential file
permanent storage
A field used to uniquely identify each record in a sequential file
token
A field used to uniquely identify each record in a sequential file
delimiter
A field used to uniquely identify each record in a sequential file
field
A field used to uniquely identify each record in a sequential file
computer file
A field used to uniquely identify each record in a sequential file
path
A field used to uniquely identify each record in a sequential file
random access file
A field used to uniquely identify each record in a sequential file
key field
A character used to specify the boundary between data items in text files
binary files
A character used to specify the boundary between data items in text files
permanent storage
A character used to specify the boundary between data items in text files
token
A character used to specify the boundary between data items in text files
delimiter
A character used to specify the boundary between data items in text files
field
A character used to specify the boundary between data items in text files
computer file
A character used to specify the boundary between data items in text files
path
A character used to specify the boundary between data items in text files
random access file
A character used to specify the boundary between data items in text files
key field
Is not lost when a computer loses power
binary files
Is not lost when a computer loses power
permanent storage
Is not lost when a computer loses power
token
Is not lost when a computer loses power
delimiter
Is not lost when a computer loses power
field
Is not lost when a computer loses power
computer file
Is not lost when a computer loses power
path
Is not lost when a computer loses power
random access file
Is not lost when a computer loses power
key field
A block of text within a string that represents an entity or a field
binary files
A block of text within a string that represents an entity or a field
permanent storage
A block of text within a string that represents an entity or a field
token
A block of text within a string that represents an entity or a field
delimiter
A block of text within a string that represents an entity or a field
field
A block of text within a string that represents an entity or a field
computer file
A block of text within a string that represents an entity or a field
path
A block of text within a string that represents an entity or a field
random access file
A block of text within a string that represents an entity or a field
key field
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
42
How can you create a class whose objects can be written to and read from data files? Show an example.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.