The true benefit of using an array lies in your ability to use a ____ as a subscript to the array.
constant
loop
command
variable - Answers variable
When you search through a list from one end to the other, you are performing a ____.
linear search
binary search
quadratic search
single lookup - Answers linear search
Which statement is true of arrays?
A. Only whole numbers can be used as array subscripts.
B. Only whole numbers can be stored in arrays.
C. Arrays cause more work for the programmer, but allow faster program execution.
D. Array elements cannot be reset after the array is declared. - Answers A
Every array has a(n) ____ size.
infinite
finite
variable
equal - Answers finite
The number of bytes in an array is always a multiple of the number of ____ in an array.
subscripts
elements
iterators
indexes - Answers elements
In every programming language, when you access data stored in an array, you must use a ____
containing a value that accesses memory occupied by the array.
superscript
subscript
key
condition - Answers subscript
Parallel arrays are most useful when value pairs have a(n) ____ relationship.
direct
indirect
linked
tiered - Answers indirect
A ____ relates parallel arrays.
superscript
key
subscript
postscript - Answers subscript
If you declare an array in Java to store boolean values, you can set each element to ____.
any number
true or false
any integer
1 or -1 - Answers true or false
When an array myArray is only partially filled, how can the programmer keep track of the current
number of elements?
A. access myArray.length()
B. maintain a companion variable that stores the current number of elements
C. access myArray.currentElements()
D. access myArray.length() - 1 - Answers B
If currLength is an integer variable that gives the number of elements currently in the array myArray,
which code snippet prints out the elements in the partially filled array of integers?
A. for (int i = 0; i < myArray.length(); i++)