program swalayan_dengan_ketentuan_jika_total_belanja_diatas_2-buah_maka_dapat_discount_10persen;
uses wincrt;
var
mkb,mnb:string;
harga,jumlah:longint;
subtotal,discount,total:real;
begin
clrscr;
write('masukkan Kode barang = ');
readln(mkb);
write('masukkan Nama Barang = ');
readln(mnb);
write('masukkan harga barang = ');
readln(harga);
write('masukkan jumlah = ');
readln(jumlah);
subtotal:=(harga*jumlah);
writeln('`````````````````````````````````````');
writeln('Barcode');
writeln(':',mkb);
writeln('Nama Barang');
writeln(':',mnb);
writeln('Harga Satuan');
writeln(':',harga);
writeln('Jumlah Barang');
writeln(':',jumlah);
writeln(' __________________________________ ');
writeln(' Joan Joan Joan Joan Joan Joan Joan ');
writeln(' ---------------------------------- ');
writeln('subtotal : ',subtotal:2:0);
if(jumlah <2 ) then
discount:=0*subtotal
else if(jumlah >2 ) then
discount:=0.02*subtotal
else
discount :=0.02*subtotal;
writeln('discount : ',discount:2:2);
total :=(subtotal-discount);
writeln('total = ',total:2:2);
readln;
end.agustiawan22.blogspot.com
Tidak ada komentar:
Posting Komentar