Multiple choiceQuestion 1 · Recall
Loading…
By the end you can read array terminology (index, lower bound, upper bound), choose 1D or 2D arrays for a task, write pseudocode to declare and use arrays, and trace linear search and bubble sort.
An array is a fixed-size, ordered collection of values that all have the same data type. Think of it as a row of lockers. Each locker has a number on its door, and you open a locker by its number.
Key terms:
Scores[3], the index is 3.Example: DECLARE Scores : ARRAY[1:10] OF INTEGER
Scores[1] is the first element and Scores[10] is the last.Scores[11] does not exist. Using it is an error called "index out of bounds".The lower bound does not have to be 1. ARRAY[5:9] is also legal, with indices 5 to 9. Most examples in this lesson start at 1.