IDENTIFICATION DIVISION.
PROGRAM-ID. LATIHAN.
AUTHOR. OMAR.
ENVIRONMEMT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01. NILAI-MASUKKAN.
02. NAMA PIC X(20).
02. NPM PIC 9(8).
02. KELAS PIC X(7).
02. MID PIC 9(2).
02. FINAL PIC 9(2)
02. RATA PIC 9(9V99).
01. NILAI-HASIL.
02. RATA-RATA PIC Z(3).
01. COBA-LAGI PIC X.
88. YA VALUE ‘Y’,’y’.
88. TIDAK VALUE ‘T’,’t’.
SCREEN SECTION.
01. CLS.
02. BLANK SCREEN.
01. TAMPILAN-INPUT.
02. LINE 5 COLUMN 5 VALUE ‘MENGHITUNG NILAI MAHASISWA’.
02. LINE 7 COLUMN 3 VALUE ‘NAMA MAHASISWA : ‘.
02. COLUMN PLUS 1 PIC X(20) TO NAMA.
02. LINE 8 COLUMN 3 VALUE ‘NPM : ‘.
02. COLUMN PLUS 1 PIC 9(8) TO NPM.
02. LINE 9 COLUMN 3 VALUE ‘KELAS: ‘.
02. COLUMN PLUS 1 PIC X(7) TO KELAS.
02. LINE 10 COLUMN 3 VALUE ‘NILAI MIDTEST : ‘.
02. COLUMN PLUS 1 PIC 9(2) TO MID.
02. LINE 11 COLUMN 3 VALUE ‘NILAI FINAL : ‘.
02. COLUMN PLUS 1 PIC 9(2) TO FINAL.
01. SELEKSI.
02. LINE 15 COLUMN 3 VALUE ‘INGIN MENCOBA LAGI [Y/T]? ‘.
02. COLUMN PLUS 1 PIC X TO COBA-LAGI.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY TAMPILAN-INPUT.
ACCEPT TAMPILAN-INPUT.
COMPUTE RATA = (MID + FINAL) / 2.
MOVE RATA TO RATA-RATA.
DISPLAY (13, 3) ‘NILAI RATA-RATA : ‘
DISPLAY SELEKSI.
ACCEPT SELEKSI.
IF YA GO TO MULAI.
SELESAI.
STOP RUN.
No comments:
Post a Comment