Wednesday, 24 June 2015

Program Penjualan Dengan Diskon (PASCAL)



Kondisi potongan harga / diskon apabila

beli 2 kostum = Rp.120000 maka potongan harga = Rp.20000
beli 2 sepatu  = Rp.160000 maka potongan harga = Rp.25000
beli 6 bola     = Rp.300000 maka potongan harga = Rp.40000



program kebanyakan_Diskon;
uses crt;
var
k,b,s :real;
ht,h,h1,h2:real;
d,d1,d2 : real;
lagi :char;
begin
lagi:='y';
while lagi ='y' do
begin
clrscr;
writeln('Program Diskon Diskon aja');
writeln;
writeln('-----------------------');
writeln('       Info Harga     ');
writeln('  kostum = Rp.60.000; ');
writeln('  sepatu = Rp.80.000; ');
writeln('  bola   = Rp.50.000; ');
writeln('----------------------');
writeln;
write('Jumlah Kostum ='); readln(k);
write('Jumlah sepatu ='); readln(b);
write('Jumlah bola ='); readln(s);


h :=60000*k;
h1:=80000*b;
h2:=50000*s;

if h>=120000 then d:=20000;
if h1>=160000 then d1:=25000;
if h2>=300000 then d2:=40000;

ht:=h-d + h1-d1 + h2-d2;
writeln;
writeln('total harga=Rp.',ht:5:0);
writeln('Diskon Kostum=Rp.',d:5:0);
writeln('Diskon Sepatu=Rp.',d1:5:0);
writeln('Diskon Bola  =Rp.',d2:5:0);
writeln('Terima Kasih');
write('Coba lagi(y/t):'); read(lagi) ;
readln;
end;
end.

No comments :

Post a Comment