Program 1 :
IDENTIFICATION DIVISION.
PROGRAM-ID. LATIH3.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 VAR.
02 NAMA PIC A(30).
02 MID PIC 9(3).
02 UAS PIC 9(3).
02 FINAL PIC Z99.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
01 MASUKAN.
02 LINE 9 COLUMN 9 VALUE "NAMA :".
02 COLUMN PLUS 2 PIC X(30) TO NAMA.
02 LINE 10 COLUMN 9 VALUE "MID :".
02 COLUMN PLUS 2 PIC 9(3) TO MID.
02 LINE 11 COLUMN 9 VALUE "UAS :".
02 COLUMN PLUS 2 PIC 9(3) TO UAS.
01 KELUARAN.
02 LINE 14 COLUMN 9 VALUE "NAMA :".
02 line 15 column 9 VALUE "uts :".
02 LINE 16 COLUMN 9 VALUE "UAS :".
02 LINE 17 COLUMN 9 VALUE "FINAL :".
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY MASUKAN.
ACCEPT MASUKAN.
COMPUTE FINAL = (0.7 * MID) + (0.3 * UAS).
DISPLAY KELUARAN.
DISPLAY (14, 17) NAMA.
DISPLAY (15, 17) MID.
DISPLAY (16, 17) UAS.
DISPLAY (17, 17) FINAL.
SELESAI.
STOP RUN.
Notepad :
Output :
Program 2 :
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
AUTHOR. SHIRO.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 UTS PIC 9(2).
77 UAS PIC 9(2).
77 TOTAL PIC 99.99.
SCREEN SECTION.
01 hapus.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY (4, 8) 'UTS : ' ACCEPT UTS.
DISPLAY (5, 8) 'UAS : ' ACCEPT UAS.
COMPUTE TOTAL= (UTS + UAS)/2.
DISPLAY (8, 8)'TOTAL : ', TOTAL.
if TOTAL >70
DISPLAY (9, 8)'Anda Lulus'
ELSE
DISPLAY (9, 8)'Anda Tidak Lulus'.
SELESAI.
STOP RUN.
Notepad :
Output :
Program 3 :
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
AUTHOR. SHIRO.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 UTS PIC 9(2).
77 UAS PIC 9(2).
77 TOTAL PIC 99.99.
SCREEN SECTION.
01 hapus.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY (4, 8) 'UTS : ' ACCEPT UTS.
DISPLAY (5, 8) 'UAS : ' ACCEPT UAS.
COMPUTE TOTAL= (UTS + UAS)/2.
DISPLAY (8, 8)'TOTAL : ', TOTAL.
if TOTAL >80 AND TOTAL <101 GO TO NILAIA.
if TOTAL >60 AND TOTAL <80 GO TO NILAIB.
if TOTAL >40 AND TOTAL <60 GO TO NILAIC.
if TOTAL >10 AND TOTAL <30 GO TO NILAID.
displaY (9, 8) 'Bodo Bangsat lu !!'.
SELESAI.
STOP RUN.
NILAIA.
displaY (9, 8) 'ANDA MENDAPAT A'.
GO TO SELESAI.
NILAIB.
displaY (9, 8) 'ANDA MENDAPAT B'.
GO TO SELESAI.
NILAIC.
displaY (9, 8) 'ANDA MENDAPAT C'.
GO TO SELESAI.
NILAID.
displaY (9, 8) 'ANDA MENDAPAT D'.
GO TO SELESAI.
Notepad :
Output :
Program 4
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 ALAS PIC 9(2).
77 TINGGI PIC 9(2).
77 LUAS PIC 99.99.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY (7, 4) 'Masukan Alas : '. ACCEPT ALAS.
DISPLAY (8, 4) 'Masukan Tinggi : '. ACCEPT TINGGI.
COMPUTE LUAS = (ALAS * TINGGI) / 2.
DISPLAY (10, 4) 'Alas : ', ALAS.
DISPLAY (11, 4) 'Tinggi : ', TINGGI.
DISPLAY (12, 4) 'Luas : ', LUAS.
STOP RUN.
Notepad :
Output :
Download Programnya ~DISINI~
Langganan:
Posting Komentar (Atom)
1 komentar:
Bagus put, lanjutkan. (y)
Posting Komentar