identification division.
program-id. perulangan3.
environment division.
data division.
screen section.
01 cls.
02 blank screen.
procedure division.
mulai.
display cls.
perform pro-a.
perform pro-b 10 times.
perform pro-a.
DISPLAY 'ASISTEN'.
perform pro-b.
Display '---------------'.
perform pro-a.
selesai.
stop run.
pro-a.
display '***************'.
pro-b.
display 'LABSI'.
Notepad :
Output:
Program 2 :
identification division.
program-id. perulangan1.
environment division.
data division.
working-storage section.
77 nama pic x(20).
77 cetak pic 99.
screen section.
01 cls.
02 blank screen.
01 inputan.
02 line 5 column 6 'Nama Anda : '.
02 column plus 2 pic x(20) to nama.
02 line 6 column 6 'Banyak Cetak : '.
02 column plus 2 pic 99 to cetak.
procedure division.
mulai.
display cls.
display inputan.
accept inputan.
perform tampil cetak times.
selesai.
stop run.
tampil.
display spaces.
display nama.
Notepad :
Output :
Program 3 :
identification division
program-id. perulangan2.
environment division.
data division.
working-storage section.
77 jawaban pic 9.
screen section.
01 cls.
02 blank screen.
procedure division.
awal.
display cls.
display 'Jabatan Anda [1,2 Atau 3]? '.
accept jawaban.
go to t1, t2, t3 depending on jawaban.
display spaces.
display 'PILIHAN ANDA SALAH, ULANGI!'
go to t4.
selesai.
stop run.
t1.
display 'TUNJANGAN ANDA RP. 100000'.
go to selesai.
t2.
display 'TUNJANGAN ANDA RP. 200000'.
go to selesai.
t3.
display 'TUNJANGAN ANDA RP. 300000'.
go to selesai.
t4.
display 'Lu salah LOL'.
go to awal.
Notepad :
Output :
Program 4 : Foreground & Background
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
ENVIRONMENT DIVISION.
DATA DIVISION.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
01 WARNA-FOREGROUND.
02 LINE 2 COLUMN 4
FOREGROUND-COLOR 10 'Warna Huruf'.
01 WARNA-BACKGROUND.
02 LINE 4 COLUMN 4
FOREGROUND-COLOR 5
BACKGROUND-COLOR 9
'Warna Huruf dan Background'.
PROCEDURE DIVISION.
MULAI.
DISPLAY WARNA-FOREGROUND.
DISPLAY WARNA-BACKGROUND.
STOP RUN.
Notepad :
Output :
Program 5 : Kondisi Grade
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 UTS PIC 999.
77 UAS PIC 999.
77 FINAL PIC 999.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
01 INPUTAN.
02 LINE 3 COLUMN 4 'Masukan Nilai UTS : '.
02 COLUMN PLUS 1 PIC ZZZ TO UTS.
02 LINE 4 COLUMN 4 'Masukan Nilai UAS : '.
02 COLUMN PLUS 1 PIC ZZZ TO UAS.
PROCEDURE DIVISION.
MULAI.
DISPLAY INPUTAN.
ACCEPT INPUTAN.
COMPUTE FINAL = (0.7 * UTS) + (0.3 * UAS).
DISPLAY (5, 4) 'Nilai Final Anda : ', FINAL.
IF FINAL > 80 AND FINAL < 100 GO TO KONDISI-A.
IF FINAL > 60 AND FINAL < 80 GO TO KONDISI-B.
IF FINAL > 40 AND FINAL < 60 GO TO KONDISI-C.
IF FINAL > 20 AND FINAL < 40 GO TO KONDISI-D.
IF FINAL > 0 AND FINAL < 20 GO TO KONDISI-E.
SELESAI.
STOP RUN.
KONDISI-A.
DISPLAY (6, 4) 'Grade A'.
GO TO SELESAI.
KONDISI-B.
DISPLAY (6, 4) 'Grade B'.
GO TO SELESAI.
KONDISI-C.
DISPLAY (6, 4) 'Grade C'.
GO TO SELESAI.
KONDISI-D.
DISPLAY (6, 4) 'Grade D'.
GO TO SELESAI.
KONDISI-E.
DISPLAY (6, 4) 'Grade E'.
GO TO SELESAI.
Notepad :
Output :
Program 6 : Kondisi Grade 2
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 UTS PIC 999.
77 UAS PIC 999.
77 FINAL PIC 999.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
01 INPUTAN.
02 LINE 3 COLUMN 4 'Masukan Nilai UTS : '.
02 COLUMN PLUS 1 PIC ZZZ TO UTS.
02 LINE 4 COLUMN 4 'Masukan Nilai UAS : '.
02 COLUMN PLUS 1 PIC ZZZ TO UAS.
PROCEDURE DIVISION.
MULAI.
DISPLAY INPUTAN.
ACCEPT INPUTAN.
COMPUTE FINAL = (0.7 * UTS) + (0.3 * UAS).
DISPLAY (5, 4) 'Nilai Final Anda : ', FINAL.
DISPLAY SPACES.
IF FINAL = 60 DISPLAY (6, 4) 'STANDAR KAYA MUKA U (LOL)'.
IF FINAL > 60 DISPLAY (6, 4) 'BAGUS ! PERTAHANKAN NAK'.
IF FINAL < 60 DISPLAY (6, 4) 'BODO BANGET U ! BELAJAR NAPA !'.
STOP RUN.
Notepad :
Output :
Program 7 : Bilangan Ganjil & Genap
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 bilangan.
02 X PIC 99.
02 Y PIC 99 VALUE 2.
02 HASIL PIC 99.
02 SISA PIC 99.
02 X1 PIC ZZ.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY (2, 4) 'Masukan angka : ', ACCEPT X.
IF x = 0 GO TO k1.
DIVIDE Y into X GIVING HASIL REMAINDER SISA.
MOVE X TO X1.
IF SISA = 0
DISPLAY X1, ' Adalah Bilangan Genap'
ELSE
DISPLAY x1, ' Adalah Bilangan Ganjil'.
SELESAI.
STOP RUN.
k1.
MOVE X TO X1.
DISPLAY 'anda memasukan bilangan KOSONG~'.
GO TO SELESAI.
Notepad :
Output :
Download programnya ~disini~
2 komentar:
dewa -_- prakteknya aja belom x_x
ini punya kelas laen cc ^0^
huehehe
Posting Komentar