IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
ENVIRONMENT DIVISION.
DATA DIVISION.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY (3, 4) 'Hello World (^o^)'.
STOP RUN.
Edit Cobol :
Output :
Program 2 :
IDENTIFICATION DIVISION.PROGRAM-ID. HELLO.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MHS.
02 NAMA PIC A(20).
02 NPM PIC 9(8).
02 KELAS PIC X(6).
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY (10, 10) 'Nama : '. ACCEPT NAMA.
DISPLAY (11, 10) 'NPM : '. ACCEPT NPM.
DISPLAY (12, 10) 'Kelas : '. ACCEPT KELAS.
DISPLAY (14, 10) 'Nama Anda : ', NAMA.
DISPLAY (15, 10) 'NPM Anda : ', NPM.
DISPLAY (16, 10) 'Kelas Anda : ', KELAS.
SELESAI.
STOP RUN.
Edit Cobol :
Output :
Program 3 :
IDENTIFICATION DIVISION.
PROGRAM-ID. BIODATA.
AUTHOR. CHORIJA.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 NAMA PIC X(30).
77 NPM PIC X(8).
77 KELAS PIC X(5).
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
01 BIODATA.
02 LINE 4 COLUMN 8 VALUE 'MASUKKAN NAMA : '.
02 COLUMN PLUS 1 PIC X(30) TO NAMA.
02 LINE 5 COLUMN 8 VALUE 'MASUKKAN NPM : '.
02 COLUMN PLUS 1 PIC X(30) TO NPM.
02 LINE 6 COLUMN 8 VALUE 'MASUKKAN KELAS : '.
02 COLUMN PLUS 1 PIC X(30) TO KELAS.
01 HASIL.
02 LINE 9 COLUMN 8 VALUE 'NAMA ANDA : '.
02 COLUMN PLUS 1 PIC X(30) FROM NAMA.
02 LINE 10 COLUMN 8 VALUE 'NPM ANDA : '.
02 COLUMN PLUS 1 PIC X(30) FROM NPM.
02 LINE 11 COLUMN 8 VALUE 'KELAS ANDA : '.
02 COLUMN PLUS 1 PIC X(30) FROM KELAS.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY BIODATA.
ACCEPT BIODATA.
DISPLAY HASIL.
STOP RUN.
Notepad :
Output :
Program 4 :
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
AUTHOR. SHIRO.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 data-input.
02 NPM PIC X(8).
02 NAMA PIC X(8).
77 KELAS PIC X(8).
77 UTS PIC 9(2).
77 UAS PIC 9(2).
77 TOTAL PIC 9(2).
77 COBA PIC X.
SCREEN SECTION.
01 hapus.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY hapus.
DISPLAY (2, 8) '--------------------------'.
DISPLAY (3, 8) 'INPUT DATA
DISPLAY (4, 8) '--------------------------'.
DISPLAY (5, 8) 'NAMA : ' ACCEPT NAMA.
DISPLAY (6, 8) 'KELAS : ' ACCEPT KELAS.
DISPLAY (7, 8) 'NPM : ' ACCEPT NPM.
DISPLAY (8, 8) 'UTS : ' ACCEPT UTS.
DISPLAY (9, 8) 'UAS : ' ACCEPT UAS.
DISPLAY (10, 8) '--------------------------'.
COMPUTE TOTAL= (UTS + UAS)/2.
DISPLAY ' '.
DISPLAY (11 8) '--------------------------'.
DISPLAY (12, 8) 'OUTPUT DATA
DISPLAY (13, 8) '--------------------------'.
DISPLAY (14, 8) 'NAMA : ', NAMA.
DISPLAY (15, 8) 'KELAS : ', KELAS.
DISPLAY (16, 8) 'NPM : ', NPM.
DISPLAY (17, 8) 'UTS : ', UTS.
DISPLAY (18, 8) 'UAS : ', UAS.
DISPLAY (19, 8) 'TOTAL : ', TOTAL.
DISPLAY (20, 8)'--------------------------'.
DISPLAY (23, 8)'INGIN COBA LAGI (Y/N) ? ' ACCEPT COBA.
IF COBA = 'Y' OR COBA = 'y' GO TO MULAI.
DISPLAY ' '.
SELESAI.
STOP RUN.
Notepad :
Output :
Download Programnya ~DISINI~
0 komentar:
Posting Komentar