Logic ch8 Flashcards

1
Q

__________ arrays are two or more arrays that hold related data, and the elements are accessed using a common subscript.

A

parallel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Variables work well in many situations, but they have limitations

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Some programming languages provide this specialized loop that steps through an array, retrieving the value of each element.

A

For Each

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Unlike variables, arrays need to be initialized separately from the declaration.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In a sequential search algorithm, the Boolean variable used as a flag is initialized to true.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

To calculate the total of the values in an array, a loop is used with an accumulator variable.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Two-dimensional arrays can be thought of as containing _________.

A

rows and columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What type of error occurs when a loop iterates one time too few or one time too many?

A

Off-by-one error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The expression score[5] is pronounced

A

score sub 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Multiple-dimensional arrays can be used to model data that occurs in multiple sets.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Array bounds checking happens at runtime, which is while the program is running.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Processing a large number of items in a(n) _____ is usually easier than processing a large number of items stored in separate variables.

A

array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Arrays, like variables, can only hold one value at a time.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the term used for the number inside the bracket that specifies the number of values that an array can hold?

A

size declarator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

One of the advantages of two or more dimensional arrays is that the data values can be of two or more data types.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The first step in calculating the average of the values in an array is to get the total of the values.

A

T

17
Q

When working with arrays, most programming languages perform _______, which means they do not allow programs to use invalid subscripts.

A

array bounds checking

18
Q

A partially filled array is normally used with _______.

A

an accompanying integer variable that holds the number of items that are actually stored in the array.

19
Q

A three-dimensional array can be thought of as ______ of two-dimensional arrays.

A

pages

20
Q

Which of the following array declarations would be best suited for storing the retail prices?

A

Declare Real retailPrice[SIZE]

21
Q

Every element in an array is assigned a unique number known as a _____.

A

subscript

22
Q

How many subscripts do you need to access one element in a two-dimensional array?

A

2