• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/19

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

19 Cards in this Set

  • Front
  • Back
A subscript is an

a. Element in an array
b. Alternate name for an array
c. Number that represents the highest value stored within an array
d. Number that indicates the position of an array element
D
Each variable in an array must have the same _____ as the others.

a. data type
b. subscript
c. value
d. memory location
A
Each data item in an array is called a(n) _____.

a. data type
b. subscript
c. component
d. element
D
The subscripts of any array are always _____.

a. integers
b. fractions
c. characters
d. strings of characters
A
Suppose you have an array named number, and two of its elements are number[1] and number[4]. You know that _____.

a. the two elements hold the same value
b. the array holds exactly four elements
c. there are exactly two elements between those two elements
d. the two elements are at the same memory location
C
Suppose you want to write a program that inputs customer data and displays a summary of the number of customers who owe more than $1,000 each, in each of 12 sales regions. Customer data variables include name, zipCode, balanceDue, and regionNumber. At some point during record processing, you would add 1 to an array element whose subscript would be represented by _____.

a. name
b. zipCode
c. balanceDue
d. regionNumber
D
The most useful type of subscript for manipulating arrays is a _____.

a. numeric constant
b. variable
c. character
d. filename
B
At the start of a program, you declare a seven-element array that holds the names of the days of the week, and a single numeric variable named dayNum. Later, you display the names using dayNum as a subscript. Near the end of the program, you can display the same array values again by writing a loop that ______________as a subscript to the array.

a. must use dayNum
b. can use dayNum, but can also use another variable
c. must not use dayNum
d. must use a numeric constant instead of a variable
B
Suppose you have declared an array as follows: num values[4] = 0, 0, 0, 0. Which of the following is an allowed operation?

a. values[2] = 17
b. input values[0]
c. values[3] = values[0] + 10
d. all of the above
D
Filling an array with values during a program’s execution is known as _____ the array.

a. executing
b. colonizing
c. populating
d. declaring
C
Using an array can make a program _____.

a. easier to understand
b. illegal in some modern languages
c. harder to maintain
d. all of the above
A
A _____ is a variable that you set to indicate whether some event has occurred.

a. subscript
b. banner
c. counter
d. flag
D
What do you call two arrays in which each element in one array is associated with the element in the same relative position in the other array?

a. cohesive arrays
b. parallel arrays
c. hidden arrays
d. perpendicular arrays
B
In most modern programming languages, the highest subscript you should use with a 10-element array is _____.

a. 8
b. 9
c. 10
d. 11
B
Parallel arrays _____.

a. frequently have an indirect relationship
b. never have an indirect relationship
c. must be the same data type
d. must not be the same data type
A
Each element in a five-element array can hold _____ value(s).

a. one
b. five
c. at least five
d. an unlimited number of
A
When you use a subscript value that is negative or higher than the number of elements in an array, _____.

a. execution of the program stops and an error message is issued
b. a value in a memory location that is outside the area occupied by the array will be accessed
c. a value in a memory location that is outside the area occupied by the array will be accessed, but only if the value is the correct data type
d. the resulting action depends on the programming language used
D
In every array, a subscript is out of bounds when it is _____.

a. negative
b. 0
c. 1
d. 999
A
You can access every element of an array using a _____.

a. while loop
b. for loop
c. both of the above
d. none of the above
C