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?

18
Q

Can you assign new values to an array element?

19
Q

Can you perform arithmetic with array elements?

20
Q

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

21
Q

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

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.

24
Q

When using parallel arrays, they contain ________ _______ data.

A

logically related

25
When using parallel arrays, what computationally relates the arrays?
the subscripts
26
The relationship between any two or more elements of a parallel array is...
indirect (relationship)
27
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)
binary search
28
When using an array to store range limits, you use a ____ to make a series of comparisons that would otherwise require many separate decisions.
loop
29
When accessing data stored in an array using a subscript containing a value that accesses memory occupied by the array.
in bounds
30
With parallel arrays, each element in one array is associated with the element in the ____ _______ position in the other array.
same relative
31
Searching through an array to find a needed value involves 3 things, which are:
1. INITIALIZING a subscript 2. USING A LOOP TO TEST each array element. 3. SETTING A FLAG when a match is found.
32
describes an array subscript that is not within the range of acceptable subscripts for its array.
out of bounds
33
An array element can be 3 things:
1. named constant 2. unnamed constant 3. variable
34
Do parallel arrays have to be the same data type?
No
35
This is a particularly convenient tool when working with arrays because initializing, testing, and altering the control variable are coded together.
for loop
36
Elements of the same data type (such as in an array) always occupy the same number of _____ of _______
bytes, memory
37
The number of bytes in an array is always a multiple of the number of _______ in an array.
elements
38
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?
Two
39
If a list has numbers[4], you know that there at least ___ elements.
5
40
Each element in an array can only hold 1 value. True or False?
True
41
When using a subscript value that is out of bounds, the resulting action depends on the ____________ ________
programming language
42
In every array, a subscript is out of bounds when it is ________.
negative