Deck 6: Arrays

Full screen (f)
exit full mode
Question
An array is a(n)____ of values in computer memory.

A) list
B) accumulation
C) set
D) record
Use Space or
up arrow
down arrow
to flip the card.
Question
In all languages,subscript values must be sequential ____.

A) characters
B) fractions
C) real numbers
D) integers
Question
You use subscripts 1 through 10 to access the elements in a ten element array.
Question
The for loop is a good tool when working with arrays because you frequently need to process every element of an array from beginning to end.
Question
All array elements have the same group ____.

A) subscript
B) name
C) memory location
D) value
Question
The number of elements in an array is called the ____ of the array.

A) width
B) size
C) height
D) depth
Question
Providing array values is sometimes called ____.

A) creating the array
B) declaring the array
C) accumulating the array
D) populating the array
Question
A program contains an array that holds all the names of the days of the week.Which of the following is true?

A) The highest subscript is 6.
B) The highest subscript is 7.
C) The lowest subscript is 1.
D) The highest subscript is 12.
Question
Many newer programming languages such as C++,Java,and C# use subscript 1 to access the first element of the array.
Question
Declaring a named constant makes code easier to modify and understand.
Question
A parallel array is an array that stores another array in each element.
Question
A(n)____ is another name for a subscript.

A) pointer
B) sequence
C) index
D) place holder
Question
When you have a five element array and use subscript 6,your subscript is said to be out of bounds.
Question
Many newer programming languages such as C++,Java,and C# use the square bracket notation for arrays.
Question
Suppose that you have declared a numeric array named numbers,and two of its elements are numbers[1] and numbers[5].You know that ____.

A) numbers[1] is smaller than numbers[5]
B) there are exactly four elements between those two elements
C) numbers[5] is the last element in the array
D) there are exactly three elements between those two elements
Question
Array elements all have the same ____ in common.

A) pointer
B) memory location
C) value
D) data type
Question
An array can be used to replace ____.

A) records
B) methods
C) nested decisions
D) loops
Question
Arrays cannot be used if you need to search for a range of values.
Question
You can improve the efficiency of a program by leaving a loop as soon as a match is found in the array.
Question
Parallel arrays must contain the same data type.
Question
To search an array for a(n)____ match,you can store either the highest or lowest value of each range for comparison.

A) flag
B) index
C) subscript
D) range
Question
When a subscript is not within the range of acceptable subscripts,it is said to be ____.

A) a superscript
B) flagged
C) out of bounds
D) indexed
Question
The number of bytes in an array is always a multiple of the number of ____ in an array.

A) subscripts
B) elements
C) iterators
D) indexes
Question
Use a(n)____________________ to indicate the position of a particular item within an array.
Question
If you declare a variable to be Boolean,you can set its value to ____.

A) any number
B) true or false
C) any integer
D) 1 or -1
Question
In every programming language,when you access data stored in an array,you must use a ____ containing a value that accesses memory occupied by the array.

A) superscript
B) subscript
C) key
D) condition
Question
When working with arrays,you can use ____________________ in several ways: To hold the size of an array,as the array values,and as a subscript .
Question
A(n)____________________ is a variable set to indicate whether some event has occurred.
Question
When you search through a list from one end to the other,you are performing a ____.

A) linear search
B) binary search
C) quadratic search
D) single lookup
Question
Which statement is true of arrays?

A) Only whole numbers can be used as array subscripts.
B) Only whole numbers can be stored in arrays.
C) Arrays cause more work for the programmer,but allow faster program execution.
D) Array elements cannot be reset after the array is declared.
Question
One advantage to using a named constant is that the statement becomes ____.

A) self-perpetuating
B) self-documenting
C) self-referencing
D) self-mitigating
Question
A ____ relates parallel arrays.

A) superscript
B) key
C) subscript
D) postscript
Question
All array elements have the same ____________________ name,but each individual element also has a unique subscript indicating how far away it is from the first element.
Question
Parallel arrays are most useful when value pairs have a(n)____ relationship.

A) direct
B) indirect
C) linked
D) tiered
Question
A subscript,also called a(n)____________________,is a number that indicates the position of a particular item within an array.
Question
Every array has a(n)____ size.

A) infinite
B) finite
C) variable
D) constant
Question
A ____ search starts looking in the middle of a sorted list,and then determines whether it should continue higher or lower.

A) linear
B) binary
C) quadratic
D) divided
Question
The true benefit of using an array lies in your ability to use a ____ as a subscript to the array.

A) constant
B) loop
C) command
D) variable
Question
Besides making your code easier to modify,using a ____ makes the code easier to understand.

A) standard constant
B) named constant
C) literal constant
D) named variable
Question
Named ____ hold values that do not change during a program's execution.

A) constants
B) variables
C) objects
D) items
Question
Match each term with a statement below.


-Each separate item in an array

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
Match each term with a statement below.


-Starts looking in the middle of a sorted list,and then determines whether it should continue higher or lower

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
Match each term with a statement below.


-In this type of array,each element in one array is associated with the element in the same relative position in the other array

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
Match each term with a statement below.


-Can hold the size of an array

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
Match each term with a statement below.


-A variable that you set to indicate whether some event has occurred

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
Match each term with a statement below.


-A subscript that is within the range of acceptable subscripts

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
Consider a mail-order business in which customers get a discount based on the quantity they order.In writing a program to compute the discount based on a customer's order quantity,why is it not a good idea to construct an array with as many elements as a customer might want to order,and store the appropriate discount associated with each number?
Question
What is an advantage of using an array to match a value in a range of values?
Question
What happens when a beginning programmer forgets that array subscripts start with 0?
Question
Match each term with a statement below.


-A particularly convenient tool when working with arrays because you frequently need to process every element of an array

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
What happens if a subscript value is negative or higher than the highest allowed subscript?
Question
Why is it desirable to leave the loop as soon as a match is found?
Question
Match each term with a statement below.


-A series of values in computer memory

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
What are the steps to verify that an item number exists in an array? Provide an example.
Question
How can constants be used when working with arrays?
Question
Match each term with a statement below.


-Providing array values

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
Describe an array and provide an example of a real-life equivalent to an array.
Question
Match each term with a statement below.


-Starts searching through a list from one end to the other

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Question
Why is it important to learn to use arrays properly?
Question
How do you reference the elements in an array?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/60
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 6: Arrays
1
An array is a(n)____ of values in computer memory.

A) list
B) accumulation
C) set
D) record
A
2
In all languages,subscript values must be sequential ____.

A) characters
B) fractions
C) real numbers
D) integers
D
3
You use subscripts 1 through 10 to access the elements in a ten element array.
False
4
The for loop is a good tool when working with arrays because you frequently need to process every element of an array from beginning to end.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
5
All array elements have the same group ____.

A) subscript
B) name
C) memory location
D) value
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
6
The number of elements in an array is called the ____ of the array.

A) width
B) size
C) height
D) depth
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
7
Providing array values is sometimes called ____.

A) creating the array
B) declaring the array
C) accumulating the array
D) populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
8
A program contains an array that holds all the names of the days of the week.Which of the following is true?

A) The highest subscript is 6.
B) The highest subscript is 7.
C) The lowest subscript is 1.
D) The highest subscript is 12.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
9
Many newer programming languages such as C++,Java,and C# use subscript 1 to access the first element of the array.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
10
Declaring a named constant makes code easier to modify and understand.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
11
A parallel array is an array that stores another array in each element.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
12
A(n)____ is another name for a subscript.

A) pointer
B) sequence
C) index
D) place holder
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
13
When you have a five element array and use subscript 6,your subscript is said to be out of bounds.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
14
Many newer programming languages such as C++,Java,and C# use the square bracket notation for arrays.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
15
Suppose that you have declared a numeric array named numbers,and two of its elements are numbers[1] and numbers[5].You know that ____.

A) numbers[1] is smaller than numbers[5]
B) there are exactly four elements between those two elements
C) numbers[5] is the last element in the array
D) there are exactly three elements between those two elements
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
16
Array elements all have the same ____ in common.

A) pointer
B) memory location
C) value
D) data type
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
17
An array can be used to replace ____.

A) records
B) methods
C) nested decisions
D) loops
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
18
Arrays cannot be used if you need to search for a range of values.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
19
You can improve the efficiency of a program by leaving a loop as soon as a match is found in the array.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
20
Parallel arrays must contain the same data type.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
21
To search an array for a(n)____ match,you can store either the highest or lowest value of each range for comparison.

A) flag
B) index
C) subscript
D) range
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
22
When a subscript is not within the range of acceptable subscripts,it is said to be ____.

A) a superscript
B) flagged
C) out of bounds
D) indexed
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
23
The number of bytes in an array is always a multiple of the number of ____ in an array.

A) subscripts
B) elements
C) iterators
D) indexes
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
24
Use a(n)____________________ to indicate the position of a particular item within an array.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
25
If you declare a variable to be Boolean,you can set its value to ____.

A) any number
B) true or false
C) any integer
D) 1 or -1
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
26
In every programming language,when you access data stored in an array,you must use a ____ containing a value that accesses memory occupied by the array.

A) superscript
B) subscript
C) key
D) condition
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
27
When working with arrays,you can use ____________________ in several ways: To hold the size of an array,as the array values,and as a subscript .
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
28
A(n)____________________ is a variable set to indicate whether some event has occurred.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
29
When you search through a list from one end to the other,you are performing a ____.

A) linear search
B) binary search
C) quadratic search
D) single lookup
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
30
Which statement is true of arrays?

A) Only whole numbers can be used as array subscripts.
B) Only whole numbers can be stored in arrays.
C) Arrays cause more work for the programmer,but allow faster program execution.
D) Array elements cannot be reset after the array is declared.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
31
One advantage to using a named constant is that the statement becomes ____.

A) self-perpetuating
B) self-documenting
C) self-referencing
D) self-mitigating
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
32
A ____ relates parallel arrays.

A) superscript
B) key
C) subscript
D) postscript
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
33
All array elements have the same ____________________ name,but each individual element also has a unique subscript indicating how far away it is from the first element.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
34
Parallel arrays are most useful when value pairs have a(n)____ relationship.

A) direct
B) indirect
C) linked
D) tiered
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
35
A subscript,also called a(n)____________________,is a number that indicates the position of a particular item within an array.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
36
Every array has a(n)____ size.

A) infinite
B) finite
C) variable
D) constant
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
37
A ____ search starts looking in the middle of a sorted list,and then determines whether it should continue higher or lower.

A) linear
B) binary
C) quadratic
D) divided
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
38
The true benefit of using an array lies in your ability to use a ____ as a subscript to the array.

A) constant
B) loop
C) command
D) variable
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
39
Besides making your code easier to modify,using a ____ makes the code easier to understand.

A) standard constant
B) named constant
C) literal constant
D) named variable
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
40
Named ____ hold values that do not change during a program's execution.

A) constants
B) variables
C) objects
D) items
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
41
Match each term with a statement below.


-Each separate item in an array

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
42
Match each term with a statement below.


-Starts looking in the middle of a sorted list,and then determines whether it should continue higher or lower

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
43
Match each term with a statement below.


-In this type of array,each element in one array is associated with the element in the same relative position in the other array

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
44
Match each term with a statement below.


-Can hold the size of an array

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
45
Match each term with a statement below.


-A variable that you set to indicate whether some event has occurred

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
46
Match each term with a statement below.


-A subscript that is within the range of acceptable subscripts

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
47
Consider a mail-order business in which customers get a discount based on the quantity they order.In writing a program to compute the discount based on a customer's order quantity,why is it not a good idea to construct an array with as many elements as a customer might want to order,and store the appropriate discount associated with each number?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
48
What is an advantage of using an array to match a value in a range of values?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
49
What happens when a beginning programmer forgets that array subscripts start with 0?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
50
Match each term with a statement below.


-A particularly convenient tool when working with arrays because you frequently need to process every element of an array

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
51
What happens if a subscript value is negative or higher than the highest allowed subscript?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
52
Why is it desirable to leave the loop as soon as a match is found?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
53
Match each term with a statement below.


-A series of values in computer memory

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
54
What are the steps to verify that an item number exists in an array? Provide an example.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
55
How can constants be used when working with arrays?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
56
Match each term with a statement below.


-Providing array values

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
57
Describe an array and provide an example of a real-life equivalent to an array.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
58
Match each term with a statement below.


-Starts searching through a list from one end to the other

A)linear search
B)in bounds
C)flag
D)parallel arrays
E)array
F)element
G)for loop
H)named constant
I)binary search
J)populating the array
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
59
Why is it important to learn to use arrays properly?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
60
How do you reference the elements in an array?
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 60 flashcards in this deck.