Anda di halaman 1dari 1

program transaksi_penjualan;

uses wincrt;
var
no_trans,tgl,jbeli,bayar,hrg,j_belanja,kd_brg:longint;
kembali,potongan,tot_belanja:real;
pembeli,nm_brg:string;
begin
clrscr;
writeln('
PROGRAM
');
writeln('
PENJUALAN
');
writeln('
Barang Dagang
');
writeln('+-----+--------+-------------------------+----------------+');
writeln('| Kode Nama Barang | Harga Barang |');
writeln('+-----+--------+------------------------------------------+');
writeln('|[K001] Sabun
| Rp.3.000
|');
writeln('|[K002] Handuk
| Rp.25.000
|');
writeln('|[K003] Sikat
| Rp.3.500
|');
writeln('+-----+--------+-------------------------+----------------+');
writeln('');
writeln('');
writeln('Silahkan isi data dibawah ini :');
write('KODE BARANG
: K-00'); readln(kd_brg);
write('NAMA PEMBELI
: '); readln(pembeli);
write('NAMA BARANG
: '); readln(nm_brg);
write('TANGGAL
: '); readln(tgl);
write('NO TRANSAKSI
: '); readln(no_trans);

case kd_brg of
1:nm_brg:='Sabun';
2:nm_brg:='Handuk';
3:nm_brg:='Sikat';
4:nm_brg:='FORMULA SIKAT GIGI';
5:nm_brg:='HANDUK';
end;
writeln('NAMA BARANG
: ',nm_brg);
if kd_brg=1 then hrg:=3000
else if kd_brg=2 then hrg:=25000
else if kd_brg=3 then hrg:=2500
else
write('HARGA
: ',hrg); writeln;
write('JUMLAH BELI
: '); readln(jbeli);
writeln;
j_belanja:=jbeli*hrg;
write('JUMLAH BELANJA
: ',j_belanja); writeln;
if j_belanja>=1000000 then potongan:=3*j_belanja;
if j_belanja>=1000000 then potongan:=3*j_belanja;
if j_belanja>=1000000 then potongan:=3*j_belanja;
write('POTONGAN
: ',potongan); writeln;
tot_belanja:=j_belanja-potongan;
write('TOTAL BELANJA
: ',tot_belanja);
writeln; writeln;
write('UANG PEMBAYARAN
: '); readln(bayar);
kembali:=bayar-tot_belanja;
write('KEMBALIAN
: ',kembali);
end.