Programming Logic & Design Unit 6
Test Answers
Suppose that an instructor assigns different letter grades based on points earned on
a 10-point quiz, and that all scores have been verified to be between 0 and 10
inclusive. Also suppose that four possible letter grades can be assigned and that 9 or
10 points is an A, 7, or 8 points is a B, 6 points is a C, and 5 or fewer points is an F.
To assign letter grades, the most efficient numeric array containing point values
would contain ... elements. - ANSWER-three
In every array, a subscript is out of bounds when it is... - ANSWER-negative
Parallel arrays... - ANSWER-frequently have an indirect relationship
When you use a subscript value that is negative or higher than the number of
elements in an array, ... - ANSWER-the resulting action depends on the
programming language used
Suppose that you have declared an array as follows: num values[4] = 0, 0, 0, 0.
Which of the following is an allowed operation? - ANSWER-output values[3]
A ... is a variable that can be set to indicate whether some event has occurred. -
ANSWER-flag
Each element in a seven-element array hold ... value(s) - ANSWER-one
A program contains a seven-element array that holds the names of the days of the
week. At the start of the program, you display the day names using a subscript
named dayNum. You display the same array values again at the end of the program,
where you ... as a subscript to the array. - ANSWER-can use dayNum, but can also
use another numeric value
Filling an array with values during a program's execution is known as ... the array. -
ANSWER-populating
The subscripts of any array are always ... - ANSWER-integers
You can access every element of an array using a ... - ANSWER-either of the above
Suppose that you have declared a numeric array named numbers, and two of its
elements are numbers[1] and numbers[4]. You know that ... - ANSWER-the array
has at least five elements.
Each element in an array must have the same ... as the others. - ANSWER-data type
Test Answers
Suppose that an instructor assigns different letter grades based on points earned on
a 10-point quiz, and that all scores have been verified to be between 0 and 10
inclusive. Also suppose that four possible letter grades can be assigned and that 9 or
10 points is an A, 7, or 8 points is a B, 6 points is a C, and 5 or fewer points is an F.
To assign letter grades, the most efficient numeric array containing point values
would contain ... elements. - ANSWER-three
In every array, a subscript is out of bounds when it is... - ANSWER-negative
Parallel arrays... - ANSWER-frequently have an indirect relationship
When you use a subscript value that is negative or higher than the number of
elements in an array, ... - ANSWER-the resulting action depends on the
programming language used
Suppose that you have declared an array as follows: num values[4] = 0, 0, 0, 0.
Which of the following is an allowed operation? - ANSWER-output values[3]
A ... is a variable that can be set to indicate whether some event has occurred. -
ANSWER-flag
Each element in a seven-element array hold ... value(s) - ANSWER-one
A program contains a seven-element array that holds the names of the days of the
week. At the start of the program, you display the day names using a subscript
named dayNum. You display the same array values again at the end of the program,
where you ... as a subscript to the array. - ANSWER-can use dayNum, but can also
use another numeric value
Filling an array with values during a program's execution is known as ... the array. -
ANSWER-populating
The subscripts of any array are always ... - ANSWER-integers
You can access every element of an array using a ... - ANSWER-either of the above
Suppose that you have declared a numeric array named numbers, and two of its
elements are numbers[1] and numbers[4]. You know that ... - ANSWER-the array
has at least five elements.
Each element in an array must have the same ... as the others. - ANSWER-data type