Deck 10: 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
Match between columns
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/42
Play
Full screen (f)
Deck 10: Arrays
1
The first variable in a one-dimensional array is assigned a subscript of ____.
A) -1
B) 0
C) 0.1
D) 1
A) -1
B) 0
C) 0.1
D) 1
B
2
Storing data in an array decreases the efficiency of a program.
False
3
Assigning initial values to an array is often referred to as ____ the array.
A) setting
B) filling
C) populating
D) initializing
A) setting
B) filling
C) populating
D) initializing
C
4
When declaring an array, you use either the ____ keyword.
A) ByVal, ByRef, ByNum
B) Array, As, Data
C) For, Array, Store
D) Dim, Private, or Static
A) ByVal, ByRef, ByNum
B) Array, As, Data
C) For, Array, Store
D) Dim, Private, or Static
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
5
The following Visual Basic statement declares a ____ array. Dim cities(3) As String
A) three-element procedure-level
B) four-element procedure-level
C) three-element class-level
D) four-element class-level
A) three-element procedure-level
B) four-element procedure-level
C) three-element class-level
D) four-element class-level
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
6
When you group together related variables, the group is referred to as a(n) ____.
A) constant
B) simple variable
C) scalar variable
D) array
A) constant
B) simple variable
C) scalar variable
D) array
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
7
If you create a numeric array without initializing the elements of the array, the computer automatically initializes each element to ____.
A) Empty
B) Nothing
C) 0
D) 1
A) Empty
B) Nothing
C) 0
D) 1
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
8
The ____ method returns an integer that represents the highest subscript in the specified dimension in the array.
A) GetLowerBound
B) GetUpperBound
C) UpperBound
D) LowerBound
A) GetLowerBound
B) GetUpperBound
C) UpperBound
D) LowerBound
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
9
Rather than having the computer use a default value to initialize each array element, you can specify each element's initial value when the array is declared.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
10
To ____ an array means to look at each array element, one by one, beginning with the first element and ending with the last element.
A) index
B) traverse
C) collapse
D) validate
A) index
B) traverse
C) collapse
D) validate
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
11
An array's ____ property tells you the number of elements in the array.
A) Elements
B) Size
C) Dimension
D) Length
A) Elements
B) Size
C) Dimension
D) Length
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
12
After an array is declared, you can use another statement to store a different value in an array element.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
13
Before you can use an array, you first must declare it.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
14
A simple variable is also called a(n) ____ variable.
A) scalar
B) array
C) dynamic
D) dimensional
A) scalar
B) array
C) dynamic
D) dimensional
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
15
The ____ of a variable indicates the variable's position in the array.
A) subscript
B) name
C) dimension
D) column
A) subscript
B) name
C) dimension
D) column
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
16
Each of the variables in an array can have a different data type.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
17
When some of the variables in a program are related to each other, it is easier and more efficient to treat the related variables as a(n) ____.
A) block
B) array
C) group
D) record
A) block
B) array
C) group
D) record
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
18
The following Visual Basic statement declares and initializes a ____ array. Private states() As String = {"Hawaii", "Alaska", "Maine"}
A) zero-element class-level
B) three-element class-level
C) zero-element procedure-level
D) three-element procedure-level
A) zero-element class-level
B) three-element class-level
C) zero-element procedure-level
D) three-element procedure-level
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
19
If the array's data type is String , each element in the array is initialized using the keyword ____.
A) Empty
B) Nothing
C) NoData
D) NoString
A) Empty
B) Nothing
C) NoData
D) NoString
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
20
If you create a Boolean array without initializing the elements of the array, the computer automatically initializes each element to ____.
A) True
B) Nothing
C) 0
D) False
A) True
B) Nothing
C) 0
D) False
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
21
Write the code to assign the strings " Madrid ", " Paris ", " Rome ", and " London " to the first, second, third and fourth variables, respectively, contained in the first row of a two-dimensional array named cities .
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
22
How do you sort the elements of a one-dimensional array in descending order?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
23
Write the statement to assign the string " Virginia " to the second element in a one-dimensional array named states .
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
24
How do you refer to a variable in an array?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
25
You use the ____ method to sort the elements in a one-dimensional array in ascending order.
A) Array.Sort
B) Array.Order
C) Array.Ascending
D) Array.SmallToLarge
A) Array.Sort
B) Array.Order
C) Array.Ascending
D) Array.SmallToLarge
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
26
Each element in a two-dimensional array is identified by ____ subscript(s).
A) one
B) two
C) three
D) four
A) one
B) two
C) three
D) four
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
27
How do you sort the elements in a one-dimensional array in ascending order?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
28
How is each variable in a two-dimensional array identified?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
29
You can use the ____________________ statement to code a loop whose instructions you want processed for each element in a group.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
30
Write the statement to declare a six-row, four-column array of strings named cities .
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
31
The ____ method sorts the elements in a one-dimensional array in descending order.
A) Array.Sort
B) Array.Order
C) Array.Reverse
D) Array.Descending
A) Array.Sort
B) Array.Order
C) Array.Reverse
D) Array.Descending
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
32
Variables initialized to the ____________________ keyword contain no data at all.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
33
A variable declared in the For Each clause of the For Each...Next statement has ____ scope.
A) block
B) procedure
C) module
D) interface
A) block
B) procedure
C) module
D) interface
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
34
Explain how and why using an array in a program affects the efficiency of the program.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
35
Arrays whose elements are used to add together values are called ____________________ arrays.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
36
You use the ____________________ property to determine the number of elements stored in an array.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
37
You can visualize a one-dimensional array as a ____.
A) single variable
B) column of variables
C) table of variables
D) cube of variables
A) single variable
B) column of variables
C) table of variables
D) cube of variables
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
38
A ____ is used to separate the row subscript from the column subscript in a two-dimensional array.
A) semicolon (;)
B) colon (:)
C) period (.)
D) comma (,)
A) semicolon (;)
B) colon (:)
C) period (.)
D) comma (,)
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
39
Programmers often associate the values in an array with a collection of items in a(n) ____________________.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
40
What is the difference between a one-dimensional array and a two-dimensional array?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
41
Match between columns
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
42
How do you traverse a two-dimensional array?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck