Wednesday, June 29, 2016

TRANSCRIPT SHEET

Problem: Make a transcript sheet in the following tubular form:




Program TRANSCRIPT SHEET
    implicit none
Character n1*3,n2*10,name*15
REAL::SUM,GPA
integer::p,I
REAL,dimension(9)::APMAT20,G
Open(2,file='Q3in.dat')
open(3,file='Q3out.dat')
read(2,21)n1,n2,p
21 format(a3,a10,/,i3)
read(2,*)APMAT20
name = n1//n2
DO I=1,9
    IF((APMAT20(I).GE.80).AND.(APMAT20(I).LT.100))THEN
        G(I)=4.00
        ELSEIF ((APMAT20(I).GE.60) .AND. (APMAT20(I).LT.80)) THEN
            G(I)=3.00
            ELSE
                G(I)=0.00
                END IF
                END DO
                SUM = 0.0
                DO I=1,9
                    SUM=SUM+G(I)
                    END DO
                    GPA=SUM/9
Write(*,10)name
10 format ('Name:',1x,a15)
Write(*,11)p
11 format('Roll:','APMAT',i3,/,'Session:2014-2015',/,/)
WRITE(*,*)'COURSE CODE    OBTAINED MARKS     GRADE POINTS'
DO I=1,9
    WRITE(*,55)I,APMAT20(I),G(I)
    55 FORMAT(2X,'APMAT20',I1,8X,F5.2,16X,F5.2)
    END DO
    WRITE(*,56)GPA
    56 FORMAT(/,'GPA='F6.3)
stop
end

No comments:

Post a Comment