Arrays
Before doing this lesson you should read sections 5.1-5.3 of the text.
NOTE: If you are using C-thru, you should now use level 3.
Up until this point we have dealt with only a few kinds of data: characters,
integers, and floats of various kinds. With this lesson we will begin our
study of arrays. Once you have arrays under your belt you will be able to
write much more interesting programs. You will be able to use the control
structures that you have learned--in particular for loops--in much more
powerful ways.
As programs become larger and more complicated, it becomes increasingly
difficult to manage the data. Variable names typically become longer to ensure
their uniqueness. And, the number of variable names makes it difficult for the
programmer to concentrate on the more important task of correct coding.
Arrays provide a mechanism for declaring and accessing several data items with
only one identifier, thereby simplifying the task of data management.
In this lesson we'll look at the use of one-dimensional arrays. As usual, we
need to copy some files before we begin.
Click here to copy files
Hamlet Project
hamlet@cs.utah.edu