# Suppose that you have declared an array as follows

• 66
• 100% (1) 1 out of 1 people found this document helpful

This preview shows page 3 - 7 out of 66 pages.

9. Suppose that 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
10. Suppose that you have declared an array as follows: num values[4] = 0, 0, 0, 0 . Which of the following is an allowed operation?
11. Filling an array with values during a program’s execution i s known as________
Programming Logic and Design, 9e Solutions 6- 4 a. executing b. colonizing c. populating d. declaring 12. A _________is a variable that can be set to indicate whether some event has occurred.
13. Two arrays in which each element in one array is associated with the element in the same relative position are ____________. a. cohesive b. parallel c. hidden d. perpendicular
14. In most modern programming languages, the highest subscript you should use with a 12-element array is ____________.
15. Parallel arrays ____________.
Programming Logic and Design, 9e Solutions 6- 5
16. Each element in a seven-element array can hold ________value(s).
17. 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. a. ten b. five c. four d. three
18. When you use a subscript value that is negative or higher than the number of elements in an array, __________.
Programming Logic and Design, 9e Solutions 6- 6 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 19. In every array, a subscript is out of bounds when it is ______________.