IDENTIFICATION DIVISION.
PROGRAM-ID. BAYAR.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DATA-MASUKA.
02 NAMA PIC A(10).
02 GAJI.
03 GAJI-POKOK PIC 9(6).
03 TUNJANGAN PIC 9(6).
03 GAJI-POKOK1 PIC Z(6).
03 TUNJANGAN1 PIC Z(6).
02 TOTAL-GAJI PIC Z(7).
02 TANYA PIC A.
SCREEN SECTION.
01 CLS.
49 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY (1, 1) 'NAMA ANDA : '. ACCEPT NAMA.
DISPLAY (2, 1) 'GAJI POKOK : Rp. '. ACCEPT GAJI-POKOK.
DISPLAY (3, 1) 'BESAR TUNJANGAN : Rp. '. ACCEPT TUNJANGAN.
COMPUTE TOTAL-GAJI = GAJI-POKOK + TUNJANGAN.
MOVE GAJI-POKOK TO GAJI-POKOK1.
MOVE TUNJANGAN TO TUNJANGAN1.
DISPLAY CLS.
DISPLAY '>> GAJI ANDA BULAN INI <<'.
DISPLAY SPACES.
DISPLAY 'NAMA : ', NAMA.
DISPLAY 'GAJI POKOK : RP. ', GAJI-POKOK1.
DISPLAY 'GAJI TUNJANGAN : RP. ', TUNJANGAN1.
DISPLAY 'TOTAL GAJI ANDA : RP. ', TOTAL-GAJI.
COBA-LAGI.
DISPLAY (9, 1) 'COBA LAGI (Y/T) ? '. ACCEPT TANYA.
IF TANYA = 'Y' OR TANYA = 'y' GO TO MULAI.
SELESAI.
STOP RUN.
Output :
Program 2
IDENTIFICATION DIVISION.
PROGRAM-ID. BAYAR.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NILAI-CELCIUS.
02 CELCIUS PIC 99V99 VALUE 50.
01 NILAI-HASIL.
02 CELCIUS-OUT PIC 99.99.
02 FAHREINHET PIC 999.99.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
PROCEDURE DIVISION.
HITUNG.
COMPUTE FAHREINHET = (1.8 * CELCIUS) + 32.
TAMPILKAN.
MOVE CELCIUS TO CELCIUS-OUT.
DISPLAY 'PRHITUNGAN '.
DISPLAY SPACES.
DISPLAY CELCIUS-OUT, ' DERAJAT CELCIUS ADALAH'.
DISPLAY FAHREINHET, ' DERAJAT FAHREINHET'.
STOP RUN.
Output :
Program 3
IDENTIFICATION DIVISION.
PROGRAM-ID. BAYAR.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DATA-MASUK.
02 UNIT1 PIC 99 VALUE 0.
02 HARGA PIC 9(5) VALUE 0.
01 DATA-KELUAR.
02 BAYAR PIC Z(7).
PROCEDURE DIVISION.
MASUKAN-DATA.
DISPLAY 'Berapa unit yang dibeli ? '. ACCEPT UNIT1.
DISPLAY 'Berapa harga per-unit ? '. ACCEPT HARGA.
HITUNG.
COMPUTE BAYAR = UNIT1 * HARGA.
TAMPILKAN.
DISPLAY SPACES.
DISPLAY 'Anda harus membayar = Rp. ', BAYAR.
SELESAI-PROSES.
STOP RUN.
Output :
0 komentar:
Posting Komentar