Program Kasir;
uses
wincrt;
label
awal,exit;
var
nam_bar :String;{nama barang}
har_sat :Real ;{harga satuan}
ban_bar :Real ;{banyak barang}
tot_har :Real ;{total harga}
uang_cash:Real ;{uang cash}
pot_har :Real ;{potongan harga}
kemb :Real ;{kembalian}
non_pot :Real ;{non potongan}
ya :char ;{kembali ke awal}
begin
awal:
clrscr;
writeln(' SELAMAT MENCOBA PROGRAM KASIR SEDERHANA BUATAN ROHMAT');
write('Nama Barang : ');readln(nam_bar);
write('Harga Satuan : Rp.');readln(har_sat);
write('Banyak Barang : ');readln(ban_bar);
tot_har:=(har_sat*ban_bar);
writeln('Total Harga : Rp.',tot_har:1:0);
if tot_har >=5000 then
pot_har:=(0.1*tot_har);
if tot_har <500 then
pot_har:=(0.0*tot_har);
writeln('Potongan Harga : Rp. ',pot_har:1:0);
write('Uang Cash : Rp.');readln(uang_cash);
kemb:=(uang_cash)-(tot_har-pot_har);
writeln('Uang Kembalian : Rp. ',kemb:1:0);
write('Masukkan Data Lagi(y/n) ? ');readln(ya);
if ya='y' then
goto awal
else if ya='n' then
goto exit;
exit:
0 komentar "Membuat Program Kasir Sederhana Di Pascal", Baca atau Masukkan Komentar
Posting Komentar