This is the code, but the error appears on line 29, and the Fortran runtime error appears: end of the file. We do not know what can be treated. It is a program in which we have to get the student's grade through a txt file.
program amarillo
implicit none
character :: expt(56)*3, expS (10)*3
integer :: udata, EoF, i, j, udata2, N, k, udata1
character :: S(10)*8
character :: t(56)*7
character :: DNI (56)*8
character :: expediente (56)*6
character (len=500) line
real :: Z(56,10), expZ(56,10), expB(10), B(10), y(56,10), W(10)
udata=1
udata1=2
udata2=3
open (unit = udata, file = 'p1_T7.TXT')
do j=1,56
read (unit = udata , iostat = EoF, fmt = '(A)') line
DNI (j) = line(1:8)
expediente (j) = line(9:14)
do i=1,10
t(i) = line (31 + i*10 : 37 + i*10 )
read (t(i),*) Z(j,i)
expt (i) = line (38 + i*10 : 40 + i*10)
read (expt(i),*) expZ(j,i)
y(j,i) = Z(j,i)*10**expZ(j,i)
end do
end do
open (unit = udata1, file = 'solutions.csv')
do k = 1,10
read(unit=udata1, iostat = EoF, fmt = '(A)')
S(k) = line(18:25)
read (s(k),*) B(k)
expS(k) = line(27:29)
read (expS(k),*) expB(k)
W(k) = B(k)*10**expB(k)
end do
open (unit =udata2, file = 'notafinal.TXT' , status = 'unknown')
do j=1,56
N=0
do i=1,10
if (y(j,i)<(W(k)*(10**5)*(10**(-4)))) then
N=N+1
else
N=N
end if
end do
write (udata2,*) "DNI =", DNI(j)
write (udata2,*) "EXPEDIENTE =", expediente(j)
write (udata2,*) "Nota=", N
end do
end program
This is the code, but the error appears on line 29, and the Fortran runtime error appears: end of the file. We do not know what can be treated. It is a program in which we have to get the student's grade through a txt file.