Question 1. Where does the element referred to with the number zero exist in an array?
One element before the first
The first element
It is determined by the declaration of the array.
It would depend on how the array is opened, once declared.
Question 2.Which of the following is false?
All elements in an array have the same subscript.
All elements of the array have the same data type.
All elements in an array have the same name.
The first element of the array has a subscript of zero.
Question 3. Suppose that we declare array foodArray() as having four elements, with corresponding values of "Bread," "Milk," "Banana," and "Sugar." What value will foodArray(2) concatenated with foodArray(0) have?
Milk Sugar
Banana Sugar
Milk Bread
Banana Bread
Question 4. An array can store multiple variables known as _____.
subscripts
a subscripted constant
indices
elements
Question 5. What exception message would be issued by the system if your program attempts to access an array with a subscript value greater than the number of elements declared in the array?
"Array dumped to memory"
"Index was outside the bounds of the array"
"Invalid access: Retry, Cancel, or Abort?"
"Unhandled exception"
Question 6. The easiest way to traverse an array or sequentially access each element in an array is to _____.
do a binary search
sort the array and read it
use a loop statement
use sequential coding
Question 7. _____ can be used when data needs to be stored in a tabular format consisting of multiple rows and columns.
Two-dimensional arrays
Indexed subscripts
Complex subscripts
List indexes
Question 8. What is the upper bound of the array score(), declared in the following line of code?
Dim score() As Integer = {55, 33, 12} (Points : 3)
2
0
11
1
Question 9. The ReDim statement causes an array to lose its current contents unless the word ReDim is followed by which keyword?
Preserve
Keep
Reserve
Conserve
Question 10. Given the Dim statement below, which set of statements will initialize all elements of myArray() to 100?
Dim myArray(100) As Double (Points : 3)
For j = 0 to 100
myArray(j) = 100
Next
For i = 0 To 100
(i) = 100
Next
myArray() is already initialized to 100 by the Dim statement.
myArray = {100}
Question 11. Consider the following Visual Basic statements:
Dim nums(4) As Double
For index As Integer = 0 To 4
nums(index) = 1 + (index * 2)
Next
What values are placed in the array by the above statements? (Show each element of the array and the value for that element.)