0% found this document useful (0 votes)
28 views2 pages

Prog Markah Fortran

The document defines variables to store student test scores for assignments, exams, and quizzes. It then prompts the user to input the number of students and their individual scores, which are stored in the arrays. The scores are summed using a function and printed out along with the total scores.

Uploaded by

hrbina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views2 pages

Prog Markah Fortran

The document defines variables to store student test scores for assignments, exams, and quizzes. It then prompts the user to input the number of students and their individual scores, which are stored in the arrays. The scores are summed using a function and printed out along with the total scores.

Uploaded by

hrbina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

INTEGER N,TUG1(10),TUG2(10),TUG3(10),UJIAN(10)

INTEGER KZ(10),FINAL(10),JUM(10)
PRINT*, 'BILANGAN PELAJAR'
READ*, N

Limit value

PRINT*, 'MASUKKAN MARKAH TUG1'


CALL BACAMARKAH(TUG1,N)
PRINT*, 'MASUKKAN MARKAH TUG2'
CALL BACAMARKAH(TUG2,N)
PRINT*, 'MASUKKAN MARKAH TUG3'
CALL BACAMARKAH(TUG3,N)
PRINT*, 'MASUKKAN MARKAH UJIAN'
CALL BACAMARKAH(UJIAN,N)
PRINT*, 'MASUKKAN MARKAH KUIZ'
CALL BACAMARKAH(KZ,N)
PRINT*, 'MASUKKAN MARKAH FINAL'
CALL BACAMARKAH(FINAL,N)

DO 16 K=1,N,1
JUM(K)=KIRAJUMLAH(TUG1(K),TUG2(K),TUG3(K),
* UJIAN(K),KZ(K),FINAL(K))
16

CONTINUE

PRINT*, 'TUG1 ',(TUG1(J), J = 1,N)


PRINT*, 'TUG2 ',(TUG2(J), J = 1,N)
PRINT*, 'TUG3 ',(TUG3(J), J = 1,N)
PRINT*, 'UJIAN ',(UJIAN(J), J = 1,N)
PRINT*, 'KUIZ ',(KZ(J), J = 1,N)
PRINT*, 'FINAL ',(FINAL(J), J = 1,N)
PRINT*, 'JUMLAH',(JUM(J), J=1,N)
READ*,C
END

SUBROUTINE BACAMARKAH(MARKAH,N)
INTEGER MARKAH(10),N
DO 15 K=1,N,1
PRINT*, 'MASUKKAN MARKAH PELAJAR KE ',K
READ*, MARKAH(K)
15

CONTINUE
RETURN
END

FUNCTION KIRAJUMLAH(TUG1,TUG2,TUG3,UJIAN,KZ,FINAL)
INTEGER TUG1,TUG2,TUG3,UJIAN,KZ,FINAL
KIRAJUMLAH=TUG1+TUG2+TUG3+UJIAN+KZ+FINAL
RETURN
END

You might also like