program 1 :
IDENTIFICATION DIVISION.
PROGRAM-ID. KUIS2.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NAMA PIC X(18).
01 TGL PIC X(2)
01 MID PIC 9(4).
01 FIN PIC 9(4).
01 HASIL PIC ZZZ.
SCREEN SECTION.
01 HAPUS-LAYAR.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY (2,2)'NAMA :'.
ACCEPT (2,16) NAMA.
DISPLAY (3,2)'TANGGAL LAHIR:'.
ACCEPT (3,16) TGL.
DISPLAY (4,2)'NILAI MID :'.
ACCEPT (4,16) MID.
DISPLAY (5,2)'NILAI FIN :'.
ACCEPT (5,16) FIN.
COMPUTE HASIL = (MID+FIN)/2.
DISPLAY (6,2)'TOTAL :'.
DISPLAY (6,15) HASIL.
DISPLAY HAPUS-LAYAR.
DISPLAY (3,2)'NAMA :'NAMA.
DISPLAY (4,2)'TANGGAL LAHIR:'TGL.
DISPLAY (5,2)'NILAI MID :'MID.
DISPLAY (6,2)'NILAI FIN :'FIN.
DISPLAY (7,2)'TOTAL :'HASIL.
STOP ' '
SELESAI.
STOP RUN.
program 2 : (perform)
IDENTIFICATION DIVISION.
PROGRAM-ID. Perform.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 X PIC 99.
77 Y PIC 99.
77 Z PIC 99.
PROCEDURE DIVISION.
Program-utama.
PERFORM Tulis
VARYING X FROM 2 BY 1 UNTIL X > 6
AFTER Y FROM 2 BY 1 UNTIL Y > X.
STOP ' '.
STOP RUN.
Tulis.
COMPUTE Z=X*Y.
DISPLAY ( , )Z,SPACE
IF Y EQUAL X
DISPLAY SPACE.
program 3 : (alter)
IDENTIFICATION DIVISION.
PROGRAM-ID. ALTER.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
TAMPILKAN.
DISPLAY 'KOMPUTER'.
PARA-1.
GO TO PARA-2.
PARA-2.
ALTER PARA-1 TO PROCEED TO SELESAI.
GO TO TAMPILKAN.
SELESAI.
STOP ' '
STOP RUN.
No comments:
Post a Comment