COBOL Program to implement LEVEL
88.
PROGRAM:
IDENTIFICATION
DIVISION.
PROGRAM-ID SGRADE.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 M1 PIC 9(2).
77 M2 PIC 9(2).
77 M3 PIC 9(2).
77 TOTAL PIC 9(4).
88 FIRST1 VALUE 180 THRU 300.
88 SECOND VALUE 180 THRU 179.
88 THIRD VALUE 180 THRU 120.
88 FAIL VALUE 180 THRU 119.
PROCEDURE DIVISION.
PARA.
DISPLAY 'ENTER STUDENT MARKS'.
ACCEPT M1.
ACCEPT M2.
ACCEPT M3.
COMPUTE TOTAL = M1 + M2 + M3.
IF FIRST1
DISPLAY 'A GRADE' ELSE
IF SECOND
DISPLAY 'B GRADE'
ELSE
IF THIRD
DISPLAY 'C GRADE'
ELSE
DISPLAY 'FAIL'.
STOP RUN.
No comments:
Post a Comment