Chapter 8 CIST 1305

25 July 2022
4.7 (114 reviews)
32 test answers

Unlock all answers in this set

Unlock answers (28)
question
One of the advantages of two- or more dimensional arrays is that the data values can be of two or more data types. A ) True B ) False
answer
False
question
Multiple-dimensional arrays can be used to model data that occurs in multiple sets. A ) True B ) False
answer
True
question
*Which of the following arguments must be passed when passing an array as an argument? A ) The array itself B ) An integer that specifies the number of elements in the array C ) The data type of the array D ) The array itself and An integer that specifies the number of elements in the array E ) The array itself and The data type of the array
answer
The array itself and An integer that specifies the number of elements in the array
question
Two-dimensional arrays can be thought of as containing ________. A ) Rows and columns B ) Lines and pages C ) Rows and lines D ) Lines and columns E ) Rows and pages
answer
Rows and columns
question
In a sequential search algorithm, the Boolean variable used as a flag is initialized to TRUE. A ) True B ) False
answer
False
question
The first step in calculating the average of the values in an array is to get the total of the values. A ) True B ) False
answer
True
question
What is the term used for the number inside the bracket that specifies the number of values that an array can hold? A ) Size B ) Size declarator C ) Number D ) Number declarator E ) None of these
answer
Size declarator
question
*When working with arrays, most programming languages perform ________, which means they do not allow programs to use invalid subscripts. A ) array bounds checking B ) buffer overrun protection C ) bitwise data execution D ) subscript binding E ) None of these
answer
array bounds checking
question
*How many subscripts do you need to access one element in a two-dimensional array? A ) One B ) Two C ) Three D ) Four E ) None of these
answer
Two
question
Array bounds checking happens at runtime, which is while the program is running. A ) True B ) False
answer
True
question
If array name contains a list of names, name[1] is the name of the first person. A ) True B ) False
answer
False
question
*The expression score[5] is pronounced ________. A ) Score of 5 B ) Score 5 C ) Score sub 5 D ) Score of 4 E ) Score sub 4
answer
Score sub 5
question
*________ arrays are two or more arrays that hold related data, and the elements are accessed using a common subscript. A ) Sequential B ) Binary C ) Parallel D ) Linear E ) None of these
answer
Parallel
question
Every element in an array is assigned a unique number known as a ________. A ) subscript B ) integer C ) character D ) number E ) None of these
answer
subscript
question
*Which is the simplest search technique to use to find an item in an array? A ) Sequential B ) Binary C ) Bubble D ) Select E ) None of these
answer
Sequential
question
What type of error occurs when a loop iterates one time too few or one time too many? A ) Run time error B ) Off-by-one error C ) Validation error D ) Syntax error E ) All of these
answer
Off-by-one error
question
A partially filled array is normally used with ________. A ) a library function that performs array insertions B ) an accompanying variable that holds a copy of the last item stored in the array C ) an accompanying integer variable that holds the number of items that are actually stored in the array D ) a warning to the user that some of the elements contain invalid values E ) None of these
answer
an accompanying integer variable that holds the number of items that are actually stored in the array
question
A three-dimensional array can be thought of as ________ of two-dimensional arrays. A ) Rows B ) Columns C ) Lines D ) Pages E ) None of these
answer
Pages
question
Variables work well in many situations, but they have limitations. A ) True B ) False
answer
True
question
*Arrays, like variables, can only hold one value at a time. A ) True B ) False
answer
False
question
Processing a large number of items in a(n) ________ is usually easier than processing a large number of items stored in separate variables. A ) Constant B ) Variable C ) Array D ) Loop E ) None of these
answer
Array
question
What is the term used for the value that is searched for in a search algorithm? A ) stringValue B ) searchValue C ) matchValue D ) flag E ) None of these
answer
searchValue
question
When processing the data in a two-dimensional array, each element has two subscripts. A ) True B ) False
answer
True
question
Which of the following array declarations would be best suited for storing the retail prices? A ) Declare String retailPrice[SIZE] B ) Declare Real retailPrice[SIZE] C ) Declare Integer retailPrice[SIZE] D ) All of these E ) None of these
answer
Declare Real retailPrice[SIZE]
question
What is the subscript for the data value 92 in the example given below? Declare Integer score [5]= 83, 92, 78, 94, 71 A ) One B ) Two C ) A D ) B E ) None of these
answer
One
question
*In the following declaration what is the data type of the elements of the array? Declare Integer numbers [SIZE] A ) SIZE B ) numbers C ) Integer D ) Declare E ) None of these
answer
Integer
question
Some programming languages provide this specialized loop that steps through an array, retrieving the value of each element. A ) While Each B ) For Each C ) Repeat Get D ) Step Loop E ) None of these
answer
For Each
question
*Which of the following statement is true about the statement below? Declare Integer score [5] = 83, 92, 78, 94, 71 A ) This is an array declaration. B ) This is an array initialization. C ) This is an array size establishment. D ) This is an array declaration and initialization. E ) This is an array declaration and size establishment.
answer
This is an array declaration and initialization.
question
Subscripts are used to identify specific elements in an array. A ) True B ) False
answer
True
question
*Unlike variables, arrays need to be initialized separately from the declaration. A ) True B ) False
answer
False
question
To calculate the total of the values in an array, a loop is used with an accumulator variable. A ) True B ) False
answer
True
question
Access the individual elements in an array by using their ________. A ) Sizes B ) Numbers C ) Integers D ) Subscripts E ) None of these
answer
Subscripts