Deck 8: Using Arrays and File Handling
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
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
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/110
Play
Full screen (f)
Deck 8: Using Arrays and File Handling
1
The elements in a string type array will be initialized to ____.
A)""
B)Null
C)" "
D)0
A)""
B)Null
C)" "
D)0
B
2
Select the correct syntax to declare an array named intReservations with 10 Integer elements.
A)Dim intReservations(9)as Integer
B)Dim intReservations(10)as Integer
C)Dim intReservations[9] as Integer
D)Dim intReservations[10] as Integer
A)Dim intReservations(9)as Integer
B)Dim intReservations(10)as Integer
C)Dim intReservations[9] as Integer
D)Dim intReservations[10] as Integer
A
3
The ____ property of an array contains the number of elements in an array.
A)Number
B)Length
C)Value
D)Dimension
A)Number
B)Length
C)Value
D)Dimension
B
4
The ____ loop can be used to process each element of an array.
A)For Element
B)For Array
C)For Each
D)For Value
A)For Element
B)For Array
C)For Each
D)For Value
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
5
The word ____ is used to declare an array.
A)DimArray
B)Array
C)InitArray
D)Dim
A)DimArray
B)Array
C)InitArray
D)Dim
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
6
The elements in an integer type array will be initialized to ____.
A)-1
B)1
C)Null
D)0
A)-1
B)1
C)Null
D)0
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
7
Each ____ in an array contains a value.
A)index
B)script
C)element
D)keyset
A)index
B)script
C)element
D)keyset
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
8
A(n)____ variable is a variable that can store more than one value.
A)indexed
B)array
C)scripted
D)evaluated
A)indexed
B)array
C)scripted
D)evaluated
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
9
Arrays provide access to data by using a numeric ____ to identify the desired element.
A)atom
B)index
C)icon
D)prefix
A)atom
B)index
C)icon
D)prefix
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
10
The ____ statement is used to assign a new array to the specified array variable.
A)ChangeSize
B)ReDim
C)ArraySize
D)NumElem
A)ChangeSize
B)ReDim
C)ArraySize
D)NumElem
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
11
____ is an accounting term used to describe the decline in a physical asset's value over a certain period of time.
A)Concatenation
B)Assignation
C)Remediation
D)Depreciation
A)Concatenation
B)Assignation
C)Remediation
D)Depreciation
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
12
The ____ keyword is used to change the number of elements in an array.
A)ReBound
B)ReSize
C)ReDim
D)ReInit
A)ReBound
B)ReSize
C)ReDim
D)ReInit
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
13

As shown in the accompanying figure,the ____ keyword will save existing data when resizing an array to a larger size.
A)Preserve
B)Dim
C)As
D)ReDim
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
14
Arrays that are ____ can be resized at run time.
A)static
B)noninteractive
C)dynamic
D)parallel
A)static
B)noninteractive
C)dynamic
D)parallel
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
15
____ arrays store related data in two or more arrays.
A)Parallel
B)Concatenated
C)Evaluated
D)Remediated
A)Parallel
B)Concatenated
C)Evaluated
D)Remediated
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
16
To access the 9th element in an array the ____ index is used.
A)(9)
B)[9]
C)(8)
D)[8]
A)(9)
B)[9]
C)(8)
D)[8]
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
17
An array can be passed as an argument to a(n)____ procedure.
A)Baseline
B)Order
C)Sort
D)Function
A)Baseline
B)Order
C)Sort
D)Function
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
18
If an element is referenced using an index that is not in the bounds of the array,a(n)____ error occurs.
A)IndexOutOfBoundsException
B)IndexOutOfRangeException
C)IndexInvalidException
D)InvalidIndexException
A)IndexOutOfBoundsException
B)IndexOutOfRangeException
C)IndexInvalidException
D)InvalidIndexException
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
19
____ sized arrays are not initialized with a set size,but instead are sized at execution to accommodate the listed values.
A)Statically
B)Baseline
C)Standard
D)Implicitly
A)Statically
B)Baseline
C)Standard
D)Implicitly
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
20
The ____ loop stops when the loop has processed every element in an array.
A)For Next
B)Array Loop
C)For Each
D)Array Vals
A)For Next
B)Array Loop
C)For Each
D)Array Vals
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
21
The ____ object is used to write text to a text file.
A)TextSave
B)StreamSave
C)Streamer
D)StreamWriter
A)TextSave
B)StreamSave
C)Streamer
D)StreamWriter
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
22
The ____method repeatedly divides the search interval of an array in half to reduce searching time dramatically.
A)HexSearch
B)BinarySearch
C)DecimalSearch
D)UnarySearch
A)HexSearch
B)BinarySearch
C)DecimalSearch
D)UnarySearch
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
23
A ____ search of an array starts at the beginning of the array and inspects each element until a match is found.
A)sequential
B)decimal
C)matching
D)hexadecimal
A)sequential
B)decimal
C)matching
D)hexadecimal
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
24
Every application begins executing a project by displaying the object designated as the ____ object.
A)Initial
B)Startup
C)Primary
D)Main
A)Initial
B)Startup
C)Primary
D)Main
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
25
The array ____ procedure is used to organize elements in an array according to their values.
A)Organize
B)Order
C)Arrange
D)Sort
A)Organize
B)Order
C)Arrange
D)Sort
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
26
The ____ procedure takes a form out of view.
A)Remove
B)Minimize
C)Hide
D)Vanish
A)Remove
B)Minimize
C)Hide
D)Vanish
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
27
The ____ object is used to access information in a text file.
A)Reader
B)TextReader
C)Streamer
D)StreamReader
A)Reader
B)TextReader
C)Streamer
D)StreamReader
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
28
In applications that include multiple forms,it is best to declare every variable as a ____ variable unless the variable is used in multiple Form objects.
A)Private
B)Hidden
C)Locked
D)Unique
A)Private
B)Hidden
C)Locked
D)Unique
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
29
Text data can be stored in a(n)____ file.
A)sequential
B)dynamic
C)archival
D)encoded
A)sequential
B)dynamic
C)archival
D)encoded
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
30
The ____ method of a StreamReader object should be used to read the next character in a file without changing position in the file.
A)CheckNext
B)Peek
C)PeekNext
D)TestNext
A)CheckNext
B)Peek
C)PeekNext
D)TestNext
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
31
A ____ form retains the input focus while open so that the user cannot switch between Form objects until the first form is closed.
A)modal
B)modeless
C)focused
D)forced
A)modal
B)modeless
C)focused
D)forced
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
32
In Visual Basic,an array can have up to ____ dimensions.
A)4
B)16
C)32
D)64
A)4
B)16
C)32
D)64
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
33
To apply the sort procedure to an array called intAges,use the syntax ____.
A)Sort(intAges)
B)Sort.Array(.intAges)
C)ArraySort(intAges)
D)Array.Sort(intAges)
A)Sort(intAges)
B)Sort.Array(.intAges)
C)ArraySort(intAges)
D)Array.Sort(intAges)
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
34
The ____ file extension indicates a text file.
A).txt
B).tex
C).txf
D).stf
A).txt
B).tex
C).txf
D).stf
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
35
A simple text file is called a ____ file.
A)sequential
B)binary
C)hexadecimal
D)unary
A)sequential
B)binary
C)hexadecimal
D)unary
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
36
To store the values contained in a table,you would use a ____ array.
A)parallel
B)grid
C)two-dimensional
D)three-dimensional
A)parallel
B)grid
C)two-dimensional
D)three-dimensional
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
37
A(n)____ form allows users to switch to other forms within the application while it is open.
A)modal
B)modeless
C)unfocused
D)forced
A)modal
B)modeless
C)unfocused
D)forced
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
38
An array with two index values for each element is a(n)____ array.
A)multi-index
B)evaluated
C)two-dimensional
D)dynamic
A)multi-index
B)evaluated
C)two-dimensional
D)dynamic
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
39
Command lines placed after the ____ method call are not executed until the second Form object is closed.
A)ShowModal
B)ShowDialog
C)OpenModal
D)ShowModeless
A)ShowModal
B)ShowDialog
C)OpenModal
D)ShowModeless
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
40
The BinarySearch procedure returns ____ if the desired value is found in the array.
A)the element's value
B)the matching index value
C)1
D)-1
A)the element's value
B)the matching index value
C)1
D)-1
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
41
An array variable can store more than five values at a time._________________________
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
42
You cannot sort arrays in reverse alphabetical order.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
43
A sequential search is the most efficient way of searching for an element.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
44
When passing an array ByVal to a ____ procedure,the original array may be changed by the procedure.
A)Sort
B)Function
C)Sub
D)Baseline
A)Sort
B)Function
C)Sub
D)Baseline
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
45
When declaring an implicitly sized array,declaring a(n)upper-bound index will cause an error to occur._________________________
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
46
The ReDim statement can be used to change the size of an array.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
47
When using a For Each loop to process each element in an array,you must specify the number of iterations for the loop.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
48
The term parallel array has the same meaning as the term two-dimensional array.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
49
You cannot return an array from a function.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
50
The access ____ determines what code has permission to read or write to the variable.
A)level
B)index
C)key
D)specifier
A)level
B)index
C)key
D)specifier
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
51
An array subscript cannot be less than 1._________________________
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
52
As with other variables,an array declared as a class-level variable is visible to all procedures within the class.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
53
An array element is accessed by using the array name and the element's ____.
A)superscript
B)index
C)subscript
D)keyset
A)superscript
B)index
C)subscript
D)keyset
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
54
When an array is initialized but do not assign values immediately,no default values are automatically assigned to the elements.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
55
All Visual Basic arrays are considered static arrays._________________________
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
56
An array can hold ____ data type values.
A)numeric
B)Boolean
C)string
D)loop
A)numeric
B)Boolean
C)string
D)loop
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
57
A nested loop can be used to process all of the elements in a(n)implicit array._________________________
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
58
The Length property returns the highest index element in the array.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
59
When using the Preserve keyword to redimension an array to a smaller size,a separate array of elements will be made to store the values that were truncated from the end of the array.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
60
When an array is declared,the numeric value specified in parentheses is the ____.
A)highest numbered index of the array
B)upperbound index
C)subscript
D)depreciation value
A)highest numbered index of the array
B)upperbound index
C)subscript
D)depreciation value
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
61
The Hide procedure of a Form object removes the form from view.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
62
An access specifier determines the availability of a variable to other parts of the application.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
63
A variable's access specifier determines what other forms may access it.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
64
An application can only contain one Windows Form object.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
65
The array procedure ____________________ arranges the elements in an array from the smallest value to the largest.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
66
In applications that include multiple forms,it is best to declare as few Private variables as possible.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
67
An instance is a special type of form that can be loaded with another form still showing.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
68
Modeless forms are used more often than modal forms in Windows applications.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
69
The ____________________ object is used to read text from a file into the program.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
70
When a form is loaded as modeless,other forms in the application can be accessed by the user.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
71
By using the Public Common access specifier,the variable's values are shared across all objects within an application.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
72
A simple text file is called a(n)____________________ file.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
73
When a form is displayed as modal,no other forms in the application can be accessed by the user until the form is closed.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
74
The ShowDialog procedure of a Form object loads a form as modal.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
75
The Show procedure of a Form object loads a form as modal.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
76
Command lines placed after the ShowDialog method call are not executed until the second Form object is closed.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
77
Objects on a form cannot be referenced from any other form.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
78
The ____________________ keyword is used to keep the existing data inside an array when the array is resized to a larger size.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
79
The Peek procedure of a StreamReader object will return -1 when the end of the file has been reached.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck
80
An array with two subscripts for each element is a(n)____________________ array.
Unlock Deck
Unlock for access to all 110 flashcards in this deck.
Unlock Deck
k this deck