CODING :
identification division.
program-id. Latih1.
environment division.
data division.
working-storage section.
01 var.
02 pil pic 9(2).
77 total pic 999(2).
77 nilai1 pic 99(2).
77 nilai2 pic 99(2).
screen section.
01 cls.
02 blank screen.
01 menu.
02 line 7 column 10 value ' menu '.
02 line 8 column 6 value '------------------'.
02 line 9 column 6 value '1. jumlah '.
02 line 10 column 6 value '2. kurang'.
02 line 11 column 6 value '3. exit'.
02 line 12 column 6 value '------------------'.
02 line 13 column 8 value 'pilihlah : '.
02 column plus 2 pic 9 to pil.
procedure division.
oke.
display cls.
display menu.
accept menu.
if pil = 1 go to mulai.
if pil = 2 go to lanjut.
if pil = 3 go to selesai.
mulai.
display cls.
display (7, 9) 'menjumlahkan 2 nilai'.
display (9, 9) 'nilai1 :'.
accept ( , ) nilai1.
display (10, 9) 'nilai2 :'.
accept ( , ) nilai2.
display (11, 9) '___________________'.
compute total= nilai1 + nilai2.
display (12, 9) 'total = ', total.
stop".
go to oke.
lanjut.
display cls.
display (7, 9) 'mengurangakan 2 nilai'.
display (9, 9) 'nilai1 :'.
accept ( , ) nilai1.
display (10, 9) 'nilai2 :'.
accept ( , ) nilai2.
display (11, 9) '___________________'.
compute total= nilai1 - nilai2.
display (12, 9) 'total = ', total.
stop".
go to oke.
selesai.
display cls.
stop run.
stop run.
OUTPUT :
1 komentar:
TERIMAKASIH
Posting Komentar