chapter 6 book Flashcards
In an array, each element has the same data type.
TRUE
Each array element is accessed using a subscript, which can be a number or a string.
FALSE
Array elements always occupy adjacent memory locations.
TRUE
You can use an array to replace a long series of decisions.
TRUE
You experience a major benefit of arrays when you use an unnamed numeric constant as a subscript as opposed to using a variable.
false
The process of displaying every element in a 10-element array is basically no different from displaying every element in a 100-element array.
true
If you create a named constant equal to an array size, you can use it as a subscript to the array.
false
If you create a named constant equal to an array size, you can use it as a limit against which to compare subscript values.
true
When you declare an array in Java, C#, or Visual Basic, a constant that represents the array size is automatically provided.
true
Only whole numbers can be stored in arrays.
false
Only whole numbers can be used as array subscripts.
true
A flag is a variable that indicates whether some event has occurred.
true
Parallel arrays must be the same data type.
false
Parallel arrays usually contain the same number of elements.
true
You can improve the efficiency of searching through parallel arrays by using an early exit.
true
To help locate a range within which a value falls, you can store the lowest value in each range in an array.
true
When using an array to store range limits, you use a series of comparisons that would otherwise require many separate loop structures.
false
Elements in an array frequently are different data types, so calculating the amount of memory the array occupies is difficult.
false
If you attempt to access an array with a subscript that is too small, some programming languages will stop execution of the program and issue an error message.
true
If you attempt to access an array with a subscript that is too large, some programming languages access an incorrect memory location outside the array bounds.
true
The for loop is a particularly convenient tool when working with arrays because initializing, testing, and altering a loop control variable are coded together.
true
You frequently need to process every element of an array from beginning to end in a linear fashion.
true
One advantage to using a for loop to process array elements is that you need not be concerned with array bounds.
false