FORTRAN programming assignment #2

 

Write a program which will read in an unspecified number of 3-digit integers  and store them in a two-dimensional array which has five (5) rows and  seven (7) columns.     As each number is read in, it should be echoed out.  The echo should have ten (10) numbers per line of output.   The values should be placed in the array by filling the first column first, the second column second, etc.

The integers will not be separated from each other (i.e. the input data will appear as shown below) but each line will contain five 3 digit integers.

  112332134013412421341234124143

Your program should contain at least one function and at least one subroutine but may have more of each. 

Your program should find:

          the largest number in the input data

          the smallest number in the input data

          the average value in the input data

          the position in the array of the first occurrence of the largest number before  and after the data is sorted.

Your program should print out the array using 5 rows and 7 columns as soon as all of the data has been read.

Then your program should sort the data in each column of the array in ascending order and print out the array again.

Your program should print out the: minimum number, the maximum number, the average of the numbers and the positions of the first occurrences of the largest number.

All output should be labeled (using sentences where appropriate and tables where appropriate).

 

Note:

If you wish, you may initialize each array location to 0 before reading and input data.