Test Output of Java calling C calling Fortran

The Java example code is invoked from a Linux shell, then the following
output is produced:
proteus.as.arizona.edu % java JavaCode
-- We are in the Java program JavaCode --
Initialize the array arr[]
0   0
1   1
2   2
3   3
4   4
5   5
6   6
7   7
8   8
9   9
Call the C code
-- We are now in the C program CCode --
Print contents of array a[] copied from arr[] in Java
0     0
1     1
2     2
3     3
4     4
5     5
6     6
7     7
8     8
9     9
Call the Fortran code
-- We are now in the Fortran program FortranCode --
Print contents of array A() copied from a[] in C program - note the unit offset
    1    0
    2    1
    3    2
    4    3
    5    4
    6    5
    7    6
    8    7
    9    8
   10    9
Calculate then print out squares of elements with accumulated sums
    1    0    0
    2    1    1
    3    4    5
    4    9   14
    5   16   30
    6   25   55
    7   36   91
    8   49  140
    9   64  204
   10   81  285
-- We have now returned back to the C program --
Print contents of array a[]
0     0
1     1
2     4
3     9
4    16
5    25
6    36
7    49
8    64
9    81
Sum of squares in array = 285
-- We are back in Java --
Contents of arr[]
0   0
1   1
2   4
3   9
4   16
5   25
6   36
7   49
8   64
9   81
Sum of squares in arr[] = 285
Exit Java
End of output