IUP Computer Science
CO 310 Spring 1982

Project 2

Write a generalized array implementation in PL6. Up to 6 dimensions must be supported using a dope vector in the implementation. Read the array specifications and element values from the files ARRAY310.COMPSCI. The data in this file is arranged as follows:

no. of dimensions (n)
lower bound 1st dimension upper bound 1st dimension
lower bound 2nd dimension upper bound 2nd dimension
    .                          .
    .                          .
lower bound nth dimension upper bound nth dimension
array element values, 10 values per record

Each value right justified in a four column field. Read in the above information, set up a dope vector to access the array.

The second portion of the file contains references. Each record is in the following form (each subscript taking four columns).

1st subscript 2nd subscript ........ nth subscript

Read each array reference and verify that the subscript is valid. If it is valid, print the value of the array'element. If it is not valid, print an appropriate message.