Deck 9: Files, Printing, and Structures

ملء الشاشة (f)
exit full mode
سؤال
This control is used to display a standard Windows Open dialog box.

A) OpenDialog
B) OpenFileDialog
C) OpenWindow
D) OpenWindowDialog
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The method writes data to a file, followed by a newline character immediately after the data.

A) PrintLine
B) WriteLine
C) WriteNewLine
D) Write
سؤال
The StreamReader object's _is used to determine when the end of the file has been reached.

A) EndOfStream property
B) Poke method
C) EOF flag
D) FileEnd flag
سؤال
In order to retain data while a program is not running, data must be saved in .

A) RAM
B) a ListBox
C) a control
D) a file
سؤال
When opening a file, use this method to determine whether a file exists before you attempt to open it:

A) ExistFilefilename)
B) IO.Existsfilename)
C) System.IO.File.Existsfilename)
D) System.File.Existsfilename)
سؤال
When the PrintDocument control's Print method is executed, it triggers the _event.

A) Printer
B) PrintDoc
C) PagePrint
D) PrintPage
سؤال
Visual Basic allows you to use an) statement to eliminate the need to prefix class names with their namespace names.

A) Include
B) With
C) Inherits
D) Imports
سؤال
When a file is selected from an Open dialog box, the path and file name are stored in the control's _property?

A) Filename
B) PathName
C) File
D) Item
سؤال
The StreamWriter's CreateText method will ___.

A) create a new file or replace an existing one
B) append text at the end of the existing file
C) insert text at the beginning of the file
D) maintain the data for an existing file
سؤال
To left justify the columns in the String.Format method, use preceding the column width.

A) a + sign
B) an & symbol
C) a - sign
D) a # symbol
سؤال
The dialog controls which open or save files are displayed using the _method.

A) DisplayDialogControl
B) DisplayDialog
C) ShowDialog
D) ShowControl
سؤال
A file is like a stream of data that must be read from its beginning to its end.

A) direct access
B) binary format
C) sequential access
D) direct format
سؤال
The StreamReader.Read method will ___.

A) read the file until an end of line character is reached.
B) read the next character from a file
C) read the contents of the file from the current read position to end of file
D) read the next word from a file
سؤال
___ 14. All of the following steps must be taken when a file is used by an application except _.

A) the file must be opened. If the file does not exist, the file will be created.
B) the file must have a fully qualified path when opening the file.
C) data is either written to the file or read from the file.
D) when the application is finished using the file, the file is closed.
سؤال
The following statements describe advantages of the Open and Save As dialog boxes except .

A) they help make an application more consistent with other Windows applications
B) they give users the ability to browse for a file
C) these dialog boxes show the user how to create and use files
D) they allow a file to be specified without typing a long path and filename
سؤال
An application must first _a file before it can be used.

A) write to
B) read from
C) open
D) unlock
سؤال
Which of the following code segments creates a new file named address.txt, writes the following two lines to the file, and then closes the file? Bob Johnson
Somewhere USA

A) Dim addressFile As System.IO.StreamWriter addressFile = System.IO.File.CreateText"address.txt")
AddressFile.Write"Bob Johnson")
AddressFile.Write"Somewhere USA")
Address.txt.Close)
B) Dim addressFile As System.IO addressFile = System.IO.File.CreateText"address.txt")
AddressFile.WriteLine"Bob Johnson")
AddressFile.WriteLine"Somewhere USA")
AddressFile.Close)
C) Dim addressFile As System.IO.StreamWriter addressFile = System.IO.File.CreateText"address.txt")
AddressFile.WriteLine"Bob Johnson")
AddressFile.WriteLine"Somewhere USA")
AddressFile.Close)
D) Dim addressFile As StreamWriter addressFile = System.IO.File.CreateText"address.txt")
AddressFile.PrintLine"Bob Johnson")
AddressFile.PrintLine"Somewhere USA")
Close)
سؤال
Which of the following code segments will read the following two lines from addressFile and place the data in two variables named strName, and strCity? Bob Johnson
Somewhere USA

A) Dim addressFile As System.IO.StreamReader addressFile = System.OpenText"address.txt")
StrName = addressFile.ReadLine)
StrCity = addressFile.ReadLine)
AddressFile.Close)
B) Dim addressFile As System.IO.StreamReader addressFile = System.IO.File.OpenText"address.txt")
StrName = addressFile.ReadLine)
StrCity = addressFile.ReadLine)
AddressFile.Close)
C) Dim addressFile As System.IO.StreamReader addressFile = OpenText"address.txt")
StrName = ReadLineaddressFile)
StrCity = ReadLineaddressFile)
Close)
D) Dim addressFile As System.IO.StreamReader addressFile = System.IO.File.OpenText"address.txt")
StrName = addressFile.Input)
StrCity = addressFile.Input)
Close)
سؤال
Identify the following statements which will: Format a string to contain the word "Name" in a column of 20 characters wide, followed by the word "Address" in a second column, also 20 characters wide.

A) String.Format"{0, 20}{1, 20}", "Name", "Address")
B) String.Format"{ 20}{ 20}", "Name", "Address")
C) String.Format20, 20, "Name", "Address")
D) String.Format20, 40, "Name", "Address")
سؤال
Which of the following statements are not true about text files?

A) contains plain text
B) cannot be viewed with an editor such as Notepad
C) is the simplest type of data file
D) known as a sequential-access file
سؤال
An Open dialog box displays the current folder unless the _property specifies a different path.

A) InitialFolder
B) DefaultDirectory
C) InitialDirectory
D) DisplayFolder
سؤال
Which of the following declares a structure data type named Complex, which has two fields named Real and Imaginary, both of which are of type Double?

A) Declare Structure Complex Dim Real As Double
Dim Imaginary As Double
End Declare
B) Structure Complex Dim Real as Double
Dim Imaginary as Double
End Structure
C) Structure As Complex Dim Real As Double
Dim Imaginary As Double
End Structure
D) Dim Structure Complex Dim RealDouble)
Dim ImaginaryDouble)
End Structure
سؤال
This method is used to add more data to the end of an existing file.

A) System.IO.File.OpenText
B) System.IO.File.AppendText
C) System.IO.File.CreateText
D) System.IO.File.OpenNew
سؤال
Reports with columnar data should not use .

A) proportionally spaced fonts
B) the Courier New font
C) monospaced fonts
D) all of the above
سؤال
This predefined constant moves the print position forward to the next even multiple of 8 columns.

A) ControlChars.CrLf
B) Tab
C) vbTab
D) Space
سؤال
The fields within a structure can be .

A) String data types
B) Integer data types
C) an array of Double data types
D) all of the above
سؤال
This method places an item of data in a file without terminating the line.

A) WriteLine
B) ReadLine
C) Append
D) Write
سؤال
To change the color of text in a windows form, you could use this.

A) FontDialog control
B) ColorDialog control
C) FontDialog control with the ShowColor property set to True
D) both b and c are correct
سؤال
What does the following line do? Do Until inputFile.EndOfStream

A) Checks to see if the file exists
B) Checks to see if the next input is -1
C) Checks to see if the file is empty
D) Checks to see if all the data in the file has been read
سؤال
The FontDialog control allows the user to determine the .

A) Font
B) Font Style
C) Font Size
D) all of the above
سؤال
The color of text printed by an

A) FontName
B) Style
C) Brushes
D) HPos
E)Graphics.DrawString statement is determined by the __________ argument.
سؤال
Which of the following writes a blank line to a text file?

A) outputFile.Write" ")
B) outputFile.WriteLine.Blank
C) outputFile.WriteLine)
D) outputFile.WriteLineBlank)
سؤال
Which of the following code segments writes the contents of three parallel arrays named strStudentName, intID, and strMajor to a file in the format below? Assume all arrays have the same number of elements. Vince Student, 1234, Computer Science
Nancy Student, 4321, Electrical Engineering

A) For intCount = 0 to strStudentName.Length - 1 outputFile.WritestrStudentNameintCount)
OutputFile.Write", ")
OutputFile.WriteintIDintCount))
OutputFile.Write", ")
OutputFile.WriteLinestrMajorintCount))
Next intCount
B) For intCount =0 to strStudentName.Length - 1 outputFile.WriteLinestrStudentNameintCount) & ", ")
OutputFile.WriteLineintIDintCount) & ", ")
OutputFile.WriteLinestrMajorintCount))
Next intCount
C) For intCount = 0 to strStudentName.Length - 1 outputFile.WritestrStudentNameintCount))
OutputFile.Write", ")
OutputFile.WriteintIDintCount))
OutputFile.Write", ")
OutputFile.WritestrMajorintCount))
Next intCount
D) For intCount = 1 to strStudentName.Length outputFile.WritestrStudentNameintCount)
OutputFile.Write", ")
OutputFile.WriteintIDintCount))
OutputFile.Write", ")
OutputFile.WritestrMajorintCount))
Next intCount
سؤال
This property allows the developer to specify the type of files that will appear in a dialog box.

A) InitialFile property
B) FileFilter property
C) Files property
D) Filter property
سؤال
To serve as a visual reminder that the structure or class name is not a variable, structure names and class names should _.

A) Begin with uppercase letters
B) Begin with an underscore
C) End with a letter
D) all of the above
سؤال
A structure should be used instead of an array when .

A) related items should be grouped together
B) related items are of different data types
C) related items contain strings of different lengths
D) there are a limited number of related items
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/36
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 9: Files, Printing, and Structures
1
This control is used to display a standard Windows Open dialog box.

A) OpenDialog
B) OpenFileDialog
C) OpenWindow
D) OpenWindowDialog
B
2
The method writes data to a file, followed by a newline character immediately after the data.

A) PrintLine
B) WriteLine
C) WriteNewLine
D) Write
B
3
The StreamReader object's _is used to determine when the end of the file has been reached.

A) EndOfStream property
B) Poke method
C) EOF flag
D) FileEnd flag
A
4
In order to retain data while a program is not running, data must be saved in .

A) RAM
B) a ListBox
C) a control
D) a file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
5
When opening a file, use this method to determine whether a file exists before you attempt to open it:

A) ExistFilefilename)
B) IO.Existsfilename)
C) System.IO.File.Existsfilename)
D) System.File.Existsfilename)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
6
When the PrintDocument control's Print method is executed, it triggers the _event.

A) Printer
B) PrintDoc
C) PagePrint
D) PrintPage
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
7
Visual Basic allows you to use an) statement to eliminate the need to prefix class names with their namespace names.

A) Include
B) With
C) Inherits
D) Imports
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
8
When a file is selected from an Open dialog box, the path and file name are stored in the control's _property?

A) Filename
B) PathName
C) File
D) Item
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
9
The StreamWriter's CreateText method will ___.

A) create a new file or replace an existing one
B) append text at the end of the existing file
C) insert text at the beginning of the file
D) maintain the data for an existing file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
10
To left justify the columns in the String.Format method, use preceding the column width.

A) a + sign
B) an & symbol
C) a - sign
D) a # symbol
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
11
The dialog controls which open or save files are displayed using the _method.

A) DisplayDialogControl
B) DisplayDialog
C) ShowDialog
D) ShowControl
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
12
A file is like a stream of data that must be read from its beginning to its end.

A) direct access
B) binary format
C) sequential access
D) direct format
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
13
The StreamReader.Read method will ___.

A) read the file until an end of line character is reached.
B) read the next character from a file
C) read the contents of the file from the current read position to end of file
D) read the next word from a file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
14
___ 14. All of the following steps must be taken when a file is used by an application except _.

A) the file must be opened. If the file does not exist, the file will be created.
B) the file must have a fully qualified path when opening the file.
C) data is either written to the file or read from the file.
D) when the application is finished using the file, the file is closed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
15
The following statements describe advantages of the Open and Save As dialog boxes except .

A) they help make an application more consistent with other Windows applications
B) they give users the ability to browse for a file
C) these dialog boxes show the user how to create and use files
D) they allow a file to be specified without typing a long path and filename
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
16
An application must first _a file before it can be used.

A) write to
B) read from
C) open
D) unlock
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which of the following code segments creates a new file named address.txt, writes the following two lines to the file, and then closes the file? Bob Johnson
Somewhere USA

A) Dim addressFile As System.IO.StreamWriter addressFile = System.IO.File.CreateText"address.txt")
AddressFile.Write"Bob Johnson")
AddressFile.Write"Somewhere USA")
Address.txt.Close)
B) Dim addressFile As System.IO addressFile = System.IO.File.CreateText"address.txt")
AddressFile.WriteLine"Bob Johnson")
AddressFile.WriteLine"Somewhere USA")
AddressFile.Close)
C) Dim addressFile As System.IO.StreamWriter addressFile = System.IO.File.CreateText"address.txt")
AddressFile.WriteLine"Bob Johnson")
AddressFile.WriteLine"Somewhere USA")
AddressFile.Close)
D) Dim addressFile As StreamWriter addressFile = System.IO.File.CreateText"address.txt")
AddressFile.PrintLine"Bob Johnson")
AddressFile.PrintLine"Somewhere USA")
Close)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
18
Which of the following code segments will read the following two lines from addressFile and place the data in two variables named strName, and strCity? Bob Johnson
Somewhere USA

A) Dim addressFile As System.IO.StreamReader addressFile = System.OpenText"address.txt")
StrName = addressFile.ReadLine)
StrCity = addressFile.ReadLine)
AddressFile.Close)
B) Dim addressFile As System.IO.StreamReader addressFile = System.IO.File.OpenText"address.txt")
StrName = addressFile.ReadLine)
StrCity = addressFile.ReadLine)
AddressFile.Close)
C) Dim addressFile As System.IO.StreamReader addressFile = OpenText"address.txt")
StrName = ReadLineaddressFile)
StrCity = ReadLineaddressFile)
Close)
D) Dim addressFile As System.IO.StreamReader addressFile = System.IO.File.OpenText"address.txt")
StrName = addressFile.Input)
StrCity = addressFile.Input)
Close)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
19
Identify the following statements which will: Format a string to contain the word "Name" in a column of 20 characters wide, followed by the word "Address" in a second column, also 20 characters wide.

A) String.Format"{0, 20}{1, 20}", "Name", "Address")
B) String.Format"{ 20}{ 20}", "Name", "Address")
C) String.Format20, 20, "Name", "Address")
D) String.Format20, 40, "Name", "Address")
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following statements are not true about text files?

A) contains plain text
B) cannot be viewed with an editor such as Notepad
C) is the simplest type of data file
D) known as a sequential-access file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
21
An Open dialog box displays the current folder unless the _property specifies a different path.

A) InitialFolder
B) DefaultDirectory
C) InitialDirectory
D) DisplayFolder
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
22
Which of the following declares a structure data type named Complex, which has two fields named Real and Imaginary, both of which are of type Double?

A) Declare Structure Complex Dim Real As Double
Dim Imaginary As Double
End Declare
B) Structure Complex Dim Real as Double
Dim Imaginary as Double
End Structure
C) Structure As Complex Dim Real As Double
Dim Imaginary As Double
End Structure
D) Dim Structure Complex Dim RealDouble)
Dim ImaginaryDouble)
End Structure
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
23
This method is used to add more data to the end of an existing file.

A) System.IO.File.OpenText
B) System.IO.File.AppendText
C) System.IO.File.CreateText
D) System.IO.File.OpenNew
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
24
Reports with columnar data should not use .

A) proportionally spaced fonts
B) the Courier New font
C) monospaced fonts
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
25
This predefined constant moves the print position forward to the next even multiple of 8 columns.

A) ControlChars.CrLf
B) Tab
C) vbTab
D) Space
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
26
The fields within a structure can be .

A) String data types
B) Integer data types
C) an array of Double data types
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
27
This method places an item of data in a file without terminating the line.

A) WriteLine
B) ReadLine
C) Append
D) Write
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
28
To change the color of text in a windows form, you could use this.

A) FontDialog control
B) ColorDialog control
C) FontDialog control with the ShowColor property set to True
D) both b and c are correct
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
29
What does the following line do? Do Until inputFile.EndOfStream

A) Checks to see if the file exists
B) Checks to see if the next input is -1
C) Checks to see if the file is empty
D) Checks to see if all the data in the file has been read
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
30
The FontDialog control allows the user to determine the .

A) Font
B) Font Style
C) Font Size
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
31
The color of text printed by an

A) FontName
B) Style
C) Brushes
D) HPos
E)Graphics.DrawString statement is determined by the __________ argument.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which of the following writes a blank line to a text file?

A) outputFile.Write" ")
B) outputFile.WriteLine.Blank
C) outputFile.WriteLine)
D) outputFile.WriteLineBlank)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
33
Which of the following code segments writes the contents of three parallel arrays named strStudentName, intID, and strMajor to a file in the format below? Assume all arrays have the same number of elements. Vince Student, 1234, Computer Science
Nancy Student, 4321, Electrical Engineering

A) For intCount = 0 to strStudentName.Length - 1 outputFile.WritestrStudentNameintCount)
OutputFile.Write", ")
OutputFile.WriteintIDintCount))
OutputFile.Write", ")
OutputFile.WriteLinestrMajorintCount))
Next intCount
B) For intCount =0 to strStudentName.Length - 1 outputFile.WriteLinestrStudentNameintCount) & ", ")
OutputFile.WriteLineintIDintCount) & ", ")
OutputFile.WriteLinestrMajorintCount))
Next intCount
C) For intCount = 0 to strStudentName.Length - 1 outputFile.WritestrStudentNameintCount))
OutputFile.Write", ")
OutputFile.WriteintIDintCount))
OutputFile.Write", ")
OutputFile.WritestrMajorintCount))
Next intCount
D) For intCount = 1 to strStudentName.Length outputFile.WritestrStudentNameintCount)
OutputFile.Write", ")
OutputFile.WriteintIDintCount))
OutputFile.Write", ")
OutputFile.WritestrMajorintCount))
Next intCount
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
34
This property allows the developer to specify the type of files that will appear in a dialog box.

A) InitialFile property
B) FileFilter property
C) Files property
D) Filter property
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
35
To serve as a visual reminder that the structure or class name is not a variable, structure names and class names should _.

A) Begin with uppercase letters
B) Begin with an underscore
C) End with a letter
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
36
A structure should be used instead of an array when .

A) related items should be grouped together
B) related items are of different data types
C) related items contain strings of different lengths
D) there are a limited number of related items
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.