Homogeneous Composite Types Of Variables: One dimensional
arrays
Notes for the required material
- You can find a text-only versions of the notes (no text-formatting or
graphics) under the Unix directory: /home/231/notes/arrays
- Arrays in Pascal (Leestma & Nyhoff Chapter
Chapter 9.1, 9.2, you may also want to read through Section 9.3 for a larger
example that uses 1D arrays): [PowerPoint]
[pdf]
Optional teaching material
Given that there is time (and if the teaching language provides such an
option) it would be beneficial for the instructor to spend time with a specific
type of array: the string. In most programming languages a string is
a type and consequently many useful utilities are provided (string operations
such as concatenation, string comparisons etc.). Another area that can be
covered if there is sufficient time is the topic of packed arrays and how they
can be used to more efficiently utilize memory but at the cost of increasing
computation time (to find the correct index).
Background / Sources of additional information
- Pascal Programming and Problem Solving by Leestma S. and Nyhoff L. 4th
Edition (MacMillan Publishing Company).
- Pascal an Introduction to the Art and Science of Programming by Savitch
W.J. (The Benjamin / Cummings Publishing Co., Inc.).
- The Pascal link under the
GNU website (since the U of C uses the GNU Pascal compiler gpc).
Teaching Tips