Deck 9: Arrays

Full screen (f)
exit full mode
Question
Assigning initial values to an array is often referred to as ____ the array.

A) setting
B) filling
C) populating
D) initializing
Use Space or
up arrow
down arrow
to flip the card.
Question
The ____ of a variable indicates the variable's position in the array.

A) subscript
B) name
C) dimension
D) column
Question
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
Question
A simple variable is also called a(n) ____ variable.

A) scalar
B) array
C) dynamic
D) dimensional
Question
Before you can use an array, you first must declare it.
Question
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
Question
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.
Question
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
Question
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
Question
Each of the variables in an array can have a different data type.
Question
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
Question
When you group together related variables, the group is referred to as a(n) ____.

A) constant
B) simple variable
C) scalar variable
D) array
Question
An array's ____ property tells you the number of elements in the array.

A) Elements
B) Size
C) Dimension
D) Length
Question
Storing data in an array decreases the efficiency of a program.
Question
After an array is declared, you can use another statement to store a different value in an array element.
Question
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
Question
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
Question
The first variable in a one-dimensional array is assigned a subscript of ____.

A) -1
B) 0
C) 0.1
D) 1
Question
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
Question
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
Question
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
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
An array variable
Question
A variable declared in the For Each clause of the For Each...Next statement has ____ scope.

A) block
B) procedure
C) module
D) interface
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Can be visualized as a table of variables
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Assign the initial values to an array
Question
Each element in a two-dimensional array is identified by ____ subscript(s).

A) one
B) two
C) three
D) four
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Used to declare a procedure-level array
Question
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 (,)
Question
You can visualize a one-dimensional array as a ____.

A) single variable
B) column of variables
C) table of variables
D) cube of variables
Question
You use the ____________________ property to determine the number of elements stored in an array.
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Assigned by the computer when an array is created in internal memory
Question
Variables initialized to the ____________________ keyword contain no data at all.
Question
Programmers often associate the values in an array with a collection of items in a(n) ____________________.
Question
You can use the ____________________ statement to code a loop whose instructions you want processed for each element in a group.
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Used to declare a class-level array
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
A group of variables that have the same name and data type and are related in some way
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Unrelated to any other variable in memory
Question
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Can be visualized as a column of variables
Question
Arranging data in a specific order is called ____________________.
Question
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
Question
How do you sort the elements in a one-dimensional array in ascending order?
Question
How do you sort the elements of a one-dimensional array in descending order?
Question
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.
Question
Explain how and why using an array in a program affects the efficiency of the program.
Question
Write the statement to declare a six-row, four-column array of strings named cities.
Question
Write the statement to assign the string "Virginia" to the second element in a one-dimensional array named states.
Question
What is the difference between a one-dimensional array and a two-dimensional array?
Question
How is each variable in a two-dimensional array identified?
Question
How do you refer to a variable in an array?
Question
How do you traverse a two-dimensional array?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 9: Arrays
1
Assigning initial values to an array is often referred to as ____ the array.

A) setting
B) filling
C) populating
D) initializing
C
2
The ____ of a variable indicates the variable's position in the array.

A) subscript
B) name
C) dimension
D) column
A
3
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
D
4
A simple variable is also called a(n) ____ variable.

A) scalar
B) array
C) dynamic
D) dimensional
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Before you can use an array, you first must declare it.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
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 50 flashcards in this deck.
Unlock Deck
k this deck
8
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
Each of the variables in an array can have a different data type.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
When you group together related variables, the group is referred to as a(n) ____.

A) constant
B) simple variable
C) scalar variable
D) array
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
An array's ____ property tells you the number of elements in the array.

A) Elements
B) Size
C) Dimension
D) Length
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
Storing data in an array decreases the efficiency of a program.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
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 50 flashcards in this deck.
Unlock Deck
k this deck
16
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
The first variable in a one-dimensional array is assigned a subscript of ____.

A) -1
B) 0
C) 0.1
D) 1
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
An array variable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
A variable declared in the For Each clause of the For Each...Next statement has ____ scope.

A) block
B) procedure
C) module
D) interface
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Can be visualized as a table of variables
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Assign the initial values to an array
Unlock Deck
Unlock for access to all 50 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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Used to declare a procedure-level array
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
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 (,)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
You can visualize a one-dimensional array as a ____.

A) single variable
B) column of variables
C) table of variables
D) cube of variables
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
You use the ____________________ property to determine the number of elements stored in an array.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Assigned by the computer when an array is created in internal memory
Unlock Deck
Unlock for access to all 50 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 50 flashcards in this deck.
Unlock Deck
k this deck
33
Programmers often associate the values in an array with a collection of items in a(n) ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
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 50 flashcards in this deck.
Unlock Deck
k this deck
35
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Used to declare a class-level array
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
A group of variables that have the same name and data type and are related in some way
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Unrelated to any other variable in memory
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Match each item with a statement below.
a.Dim
f.two-dimensional array
b.simple variable
g.Private
c.populate
h.one-dimensional array
d.element
i.array
e.subscript
Can be visualized as a column of variables
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
Arranging data in a specific order is called ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
How do you sort the elements in a one-dimensional array in ascending order?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
How do you sort the elements of a one-dimensional array in descending order?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
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 50 flashcards in this deck.
Unlock Deck
k this deck
44
Explain how and why using an array in a program affects the efficiency of the program.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
Write the statement to declare a six-row, four-column array of strings named cities.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
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 50 flashcards in this deck.
Unlock Deck
k this deck
47
What is the difference between a one-dimensional array and a two-dimensional array?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
How is each variable in a two-dimensional array identified?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
How do you refer to a variable in an array?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
How do you traverse a two-dimensional array?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.