Deck 7: Arrays
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/79
Play
Full screen (f)
Deck 7: Arrays
1
An array must be declared and allocated in the same statement.
False
2
Arrays consist of items of different types.
False
3
The braces { and } delimit an:
A)indexing list
B)allocator list
C)initializer list
D)array list
A)indexing list
B)allocator list
C)initializer list
D)array list
C
4
An array reference may be assigned only to a different array of the same size as the array it's currently referencing.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
5
To declare an array one must provide the:
A)array name and array size
B)array name and data type
C)array size and data type
D)array name,array size and data type
A)array name and array size
B)array name and data type
C)array size and data type
D)array name,array size and data type
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following statements about arrays are true?
I)Arrays are groups of variables that all have the same type.
II)Elements are located by index
III)The length of an array c is determined by the expression c.Length.
IV)The zeroth element of array c is specified by c(0).
A)I,III,and IV.
B)I,II,and IV.
C)both III and IV.
D)I,II,III,and IV.
I)Arrays are groups of variables that all have the same type.
II)Elements are located by index
III)The length of an array c is determined by the expression c.Length.
IV)The zeroth element of array c is specified by c(0).
A)I,III,and IV.
B)I,II,and IV.
C)both III and IV.
D)I,II,III,and IV.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
7
The amount of memory required by an array depends on the:
A)length of the array
B)size of the data type of the elements in the array
C)both a and b
D)None of the above
A)length of the array
B)size of the data type of the elements in the array
C)both a and b
D)None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
8
The position number in square brackets is formally called an index.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
9
Consider the array: s( 0 )= 7

The value of s( s( 6 )- s( 5 ))is:
A)0.
B)3
C)9
D)0

The value of s( s( 6 )- s( 5 ))is:
A)0.
B)3
C)9
D)0
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
10
The first element in every array is the 0th element.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
11
The number in parentheses after an array name is the of the item in the array.
A)value
B)position
C)size
D)None of the above.
A)value
B)position
C)size
D)None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
12
Arrays normally are data structures.
A)constant
B)dynamic
C)static
D)None of the above.
A)constant
B)dynamic
C)static
D)None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
13
Only literal integer values can be used as an index into an array.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
14
All arrays have access to the methods and properties of this class:
A)VisualBasic.Array
B)Microsoft.Array
C)System.Array
D)None of the Above
A)VisualBasic.Array
B)Microsoft.Array
C)System.Array
D)None of the Above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
15
You must do the following before using an array:
A)declare then reference the array
B)initialize then declare the array
C)initialize then reference the array
D)declare then initialize the array
A)declare then reference the array
B)initialize then declare the array
C)initialize then reference the array
D)declare then initialize the array
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
16
Arrays may have dimensions.
A)one
B)two
C)any number of
D)a or b
A)one
B)two
C)any number of
D)a or b
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
17
Which of the following correctly accesses element 13 of array Book?
A)Book(0)+ 13
B)Book(13)
C)Book[13]
D)None of the above.
A)Book(0)+ 13
B)Book(13)
C)Book[13]
D)None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
18
The value used to indicate a specific location within an array is called the index or subscript.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
19
Consider the code segment below.Which of the following statements is false? 
A)The first statement declares an array reference.
B)The second statement creates the array.
C)array is a reference to an array of integers.
D)The value of array( 3 )is -1.

A)The first statement declares an array reference.
B)The second statement creates the array.
C)array is a reference to an array of integers.
D)The value of array( 3 )is -1.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
20
The number of elements in the array must be specified in parentheses after the array name in the declaration.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
21
If an attempt is made to use an invalid index to access an element,a(an)__________exception occurs.
A)InvalidIndexException
B)RangeException
C)IndexOutOfRangeException
D)None of the above.
A)InvalidIndexException
B)RangeException
C)IndexOutOfRangeException
D)None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
22
Consider the code below: 
The value of variable result will be:
A)280
B)154
C)286
D)332

The value of variable result will be:
A)280
B)154
C)286
D)332
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
23
Values in an array can be totaled by using the ArrayTotal method.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
24
Arrays can be used as sets of counters.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
25
Invalid possibilities for array indices include .
A)positive integers
B)negative integers
C)zero
A)positive integers
B)negative integers
C)zero
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
26
Often,the elements of an array represent a series of related values that are used in a calculation.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
27
A ComboBox combines features of a TextBox and a __________.
A)Button
B)Itembox
C)ListBox
D)SliderBox
A)Button
B)Itembox
C)ListBox
D)SliderBox
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
28
In an array of reference types,each element may be a reference to a different type.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
29
In an array of Boolean variables,if the initializer list is empty,the elements in the array are initialized to the default value True.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
30
When an expression contains nested parentheses,its evaluation begins with the value in the outermost set of parentheses.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
31
Visual Basic can determine the array bounds from the number of elements in the initializer list.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
32
Arrays can hold only data of primitive types.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
33
The expression array.GetUpperBound(1)can be used to determine the upper bound of a one-dimensional array.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
34
The declaration and allocation of an array can be combined into one statement.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
35
Array method GetUpperBound returns the index of the last element in an array.The value returned by method GetUpperBound is one less than the value of the array's Length property.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
36
Each reference in an array of references is pointed to Nothing by default when the array is allocated.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
37
When a program is executed,array element indices are checked for validity-all indices must be greater than or equal to 0 and less than or equal to the length of the array.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
38
Referencing an element outside the array bounds is a:
A)syntax error
B)compile error
C)runtime error
D)None of the above
A)syntax error
B)compile error
C)runtime error
D)None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
39
Consider the code below: 
The value of variable result will be:
A)62
B)64
C)65
D)67

The value of variable result will be:
A)62
B)64
C)65
D)67
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
40
Which of the following will not produce a compiler error?
A)Changing the value of a constant after it's declared.
B)Changing the value at a given index of an array after it's created.
C)Using a constant variable before it's initialized.
D)All of the above will produce compiler errors.
A)Changing the value of a constant after it's declared.
B)Changing the value at a given index of an array after it's created.
C)Using a constant variable before it's initialized.
D)All of the above will produce compiler errors.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
41
When passing an array to a procedure,the method's parameter list must
specify that an array will be received.
specify that an array will be received.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
42
The For Each…Next repetition statement is appropriate when the program doesn't need to refer to the indices of the elements in an array.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
43
String method Replace receives two arguments-the substring that should be replaced throughout the original String and the replacement substring.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
44
Which of the following is not a way of sorting data?
A)ascending
B)descending
C)random
D)None of the above
A)ascending
B)descending
C)random
D)None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
45
For Each…Next loop is barely used because it's more complicated than the For…Next loop.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
46
Which method call does the method head Sub ModifyArray(ByVal a As Double())represent? Assume that the array being passed (list)is already defined.
A)ModifyArray( double()list )
B)ModifyArray( double(): list )
C)ModifyArray( double list())
D)ModifyArray( list )
A)ModifyArray( double()list )
B)ModifyArray( double(): list )
C)ModifyArray( double list())
D)ModifyArray( list )
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
47
ComboBox property ItemSource specifies the source of the items displayed in the ComboBox.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
48
The For Each…Next repetition statement requires you to provide an array,its type and a variable for the purpose of:
A)preventing the statement from going past the end of the array
B)storing the value of each typed element that's traversed
C)acting as a counter to traverse the array
D)None of the above.
A)preventing the statement from going past the end of the array
B)storing the value of each typed element that's traversed
C)acting as a counter to traverse the array
D)None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
49
When using the Sort method from the Array class,the method will sort the passed in array in descending order.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
50
Array element values of primitive data types,such as Integer,can be passed to a method by:
A)value
B)reference
C)both a and b
D)None of the above
A)value
B)reference
C)both a and b
D)None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
51
An individual element of an integer array is passed to a method by value.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
52
Class Array provides methods for _________ arrays.
A)creating
B)modifying
C)sorting
D)searching
E)All of the above
A)creating
B)modifying
C)sorting
D)searching
E)All of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
53
Changes made to an entire array that has been passed to a method will not affect the original values of the array.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
54
ComboBox property __________specifies the maximum number of items to display at one time.
A)MaxDropDownItems
B)MaxItems
C)MaxDisplayItems
D)None of the above
A)MaxDropDownItems
B)MaxItems
C)MaxDisplayItems
D)None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
55
When we pass an array object to a procedure,we do not need to pass the upper
bound of the array as a separate argument.
bound of the array as a separate argument.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
56
What is the proper For Each…Next header format?
A)For Each Type in arrayName
B)For Each arrayName
C)For Each type_identifer As Type In arrayName
D)None of the above.
A)For Each Type in arrayName
B)For Each arrayName
C)For Each type_identifer As Type In arrayName
D)None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
57
If you want to pass an array element into a method by reference,what will you need to do?
A)It always passes the element as a reference automatically.
B)Use the keyword ByRef
C)Each of the above.
D)None of the above,passing in by reference of an array element is only possible if the array type is a reference type.
A)It always passes the element as a reference automatically.
B)Use the keyword ByRef
C)Each of the above.
D)None of the above,passing in by reference of an array element is only possible if the array type is a reference type.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
58
To pass an array argument to a method,specify the name of the array followed by empty parentheses.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
59
An array itself can be passed to a method by:
A)value
B)reference
C)both a and b
D)None of the above
A)value
B)reference
C)both a and b
D)None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
60
Class Array's method SortDesc will sort an array in descending order.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
61
The optional ________ keyword in the ReDim statement will keep the existing array elements after the array is resized.
A)Keep
B)Copy
C)Preserve
D)Save
A)Keep
B)Copy
C)Preserve
D)Save
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
62
After each comparison,the binary search algorithm eliminates from consideration half the elements in the array that's being searched.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
63
The linear search method works best for searching arrays.
A)small and sorted
B)large and sorted
C)small and unsorted
D)large and unsorted
A)small and sorted
B)large and sorted
C)small and unsorted
D)large and unsorted
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
64
The ReDim statement is used only to expand an array.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
65
In array items,which expression below will retrieve the value at row 3 and column 5?
A)items( 3 ).( 5 )
B)items( 3( 5 ))
C)items( 3 )( 5 )
D)items( 3,5 )
A)items( 3 ).( 5 )
B)items( 3( 5 ))
C)items( 3 )( 5 )
D)items( 3,5 )
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
66
What does the ReDim statement allow for?
A)Expanding any dynamic data structure.
B)Re-declaring a variable.
C)Expanding an array.
D)None of the above.
A)Expanding any dynamic data structure.
B)Re-declaring a variable.
C)Expanding an array.
D)None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
67
The binary search method only works for searching arrays.
A)small
B)large
C)sorted
D)unsorted
A)small
B)large
C)sorted
D)unsorted
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
68
A RadioButton is known as a switch button because it can be in only the "on" (True)state or the "off" (False)state.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
69
A linear search always compares every element in an array to a certain key value.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
70
For the array in the previous question,what is the value returned by items( 1,0 )?
A)4
B)8
C)12
D)6
A)4
B)8
C)12
D)6
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
71
The ReDim statement will automatically save the data stored in the array.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
72
RadioButtons can be separated into several groups,but all of the groups must be in the same container (typically a GroupBox).
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
73
Which statement below initializes array items to contain 3 rows and 2 columns?
A)Dim items(,)As Integer = {{ 2,4 },{ 6,8 },{ 10,12 }}
B)Dim items(,)As Integer = {{ 2,6,10 },{ 4,8,12 }};
C)Dim items(,)As Integer = { 2,4 },{ 6,8 },{ 10,12 };
D)Dim items(,)As Integer = { 2,6,10 },{ 4,8,12 };
A)Dim items(,)As Integer = {{ 2,4 },{ 6,8 },{ 10,12 }}
B)Dim items(,)As Integer = {{ 2,6,10 },{ 4,8,12 }};
C)Dim items(,)As Integer = { 2,4 },{ 6,8 },{ 10,12 };
D)Dim items(,)As Integer = { 2,6,10 },{ 4,8,12 };
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
74
The ReDim statement enables you to dynamically change the array size,type of the array elements,and the number of dimensions in the array.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
75
How many RadioButtons in a group can be selected at a time?
A)0
B)1
C)2
D)all of them
A)0
B)1
C)2
D)all of them
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
76
A __________ event occurs when a RadioButton is either selected or deselected.
A)SelectChanged
B)CheckedChanged
C)SelectDeselect
D)None of the above
A)SelectChanged
B)CheckedChanged
C)SelectDeselect
D)None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
77
Rectangular arrays are often used to represent tables of values consisting of information arranged in:
A)rows
B)columns
C)both a and b
D)None of the above
A)rows
B)columns
C)both a and b
D)None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
78
Multi-dimensional arrays require two or more indices to identify particular elements.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
79
An array with m rows and n columns is not:
I.An m-by-n array.
II.An n-by-m array.
III.A two-dimensional array.
IV.A dual-transcripted array.
A)I and III
B)I and IV
C)II and IV
D)II and III
I.An m-by-n array.
II.An n-by-m array.
III.A two-dimensional array.
IV.A dual-transcripted array.
A)I and III
B)I and IV
C)II and IV
D)II and III
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck