Chapter 6 (Arrays) Flashcards

1
Q

In an array, the values can be different data types. True or False?

A

False

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

Usually, all the values in an array have _________ __ ______.

A

something in common

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

Each data item in an array is an…

A

element

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

These provide an organized storage and display system for a program’s data

A

an array

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

a series or list of values in a computer’s memory

A

array

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

each element in an array occupies an area in memory that is _________ to the others.

A

contiguous / adjacent

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

naming arrays follow the same rules as naming ________.

A

variables

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

an array name is not allowed to contain _________ ______.

A

embedded spaces

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

This differentiates elements in an array from each other

A

subscript/index

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

Subscripts cannot be _____ numbers.

A

real/floating

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

The position of a particular element within an array.

A

subscript / index

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

what is the most common symbol used to denote a subscript number?

A

brackets

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

Subscripts for an array always start at…

A

0

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

Assigning values to an array is called…

A

populating the array

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

the largest possible _______ in an array will always be arraySize - 1

A

subscript

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

[0]

A

sub zero

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

Can you declare and initialize array elements in one statement?

A

Yes

18
Q

Can you assign new values to an array element?

A

Yes

19
Q

Can you perform arithmetic with array elements?

A

Yes

20
Q

Usable subscripts for an array range from 0 to one ____ than the number of elements in an array.

A

less

21
Q

True or False: You cannot use a named constant as a subscript.

A

False

22
Q

performing a search through a list from end to end

A

linear search

23
Q

Flags: a variable that is set to indicate whether some _____ has occurred.

A

event

24
Q

When using parallel arrays, they contain ________ _______ data.

A

logically related

25
Q

When using parallel arrays, what computationally relates the arrays?

A

the subscripts

26
Q

The relationship between any two or more elements of a parallel array is…

A

indirect (relationship)

27
Q

comparing the value sought with the middle element in a sorted list. If the sought value is lower, you eliminate the second half of the list (or vice versa)

A

binary search

28
Q

When using an array to store range limits, you use a ____ to make a series of comparisons that would otherwise require many separate decisions.

A

loop

29
Q

When accessing data stored in an array using a subscript containing a value that accesses memory occupied by the array.

A

in bounds

30
Q

With parallel arrays, each element in one array is associated with the element in the ____ _______ position in the other array.

A

same relative

31
Q

Searching through an array to find a needed value involves 3 things, which are:

A
  1. INITIALIZING a subscript
  2. USING A LOOP TO TEST each array element.
  3. SETTING A FLAG when a match is found.
32
Q

describes an array subscript that is not within the range of acceptable subscripts for its array.

A

out of bounds

33
Q

An array element can be 3 things:

A
  1. named constant
  2. unnamed constant
  3. variable
34
Q

Do parallel arrays have to be the same data type?

A

No

35
Q

This is a particularly convenient tool when working with arrays because initializing, testing, and altering the control variable are coded together.

A

for loop

36
Q

Elements of the same data type (such as in an array) always occupy the same number of _____ of _______

A

bytes, memory

37
Q

The number of bytes in an array is always a multiple of the number of _______ in an array.

A

elements

38
Q

If you declare a numeric array named numbers, and two of its elements are numbers[1] and numbers[4], how many elements are between them?

A

Two

39
Q

If a list has numbers[4], you know that there at least ___ elements.

A

5

40
Q

Each element in an array can only hold 1 value. True or False?

A

True

41
Q

When using a subscript value that is out of bounds, the resulting action depends on the ____________ ________

A

programming language

42
Q

In every array, a subscript is out of bounds when it is ________.

A

negative