Coding:
program KP;
uses crt;
var
jumlah: integer;
pulsa : byte;
diskon : real;
kembali, bayar,harga, jumlahbayar:longint;
kode, op, bonus : string;
begin
clrscr;
writeln(' WELCOME TO MY COUNTER ');
writeln('--------------------------------------------------------------');
writeln('| Kode Voucher| Nama Operator | Pulsa | Harga |');
writeln('--------------------------------------------------------------');
writeln('| SPT | Simpati | 25 | 26.000 |');
writeln('| | | 50 | 51.000 |');
writeln('| | | 100 | 96.000 |');
writeln('--------------------------------------------------------------');
writeln('| TRE | Three | 10 | 11.000 |');
writeln('| | | 30 | 31.000 |');
writeln('| | | 100 | 98.000 |');
writeln('--------------------------------------------------------------');
writeln('| ESA | Esia | 10 | 12.000 |');
writeln('| | | 25 | 22.000 |');
writeln('| | | 100 | 96.000 |');
writeln('--------------------------------------------------------------');
write('Kode Voucher = ');readln(kode);
write('Pulsa yang di beli = ');readln(pulsa);
write('Jumlah yang akan dibeli = ');readln(jumlah);
if kode = 'spt'then
begin
op:='Simpati';
if pulsa = 25 then harga := 25000
else if pulsa = 50 then harga := 51000
else harga := 96000;
end;
if kode = 'tre' then
begin
op:='Three';
if pulsa = 10 then harga := 11000
else if pulsa = 30 then harga := 31000
else harga := 98000; end;
if kode = 'esa' then
begin
op:='ESIA';
if pulsa = 10 then harga := 12000
else if pulsa = 25 then harga := 22000
else harga := 96000;
end;
if (jumlah > 250) then
begin
diskon:= (jumlah*harga)*0.1;
bonus := 'Gantungan Hp'
end
else if (jumlah > 100) then
begin
diskon:= (jumlah*harga)*0.5;
bonus := 'Stiker Radiasi'
end
else
begin
diskon:= 0*(jumlah*harga);
bonus:= ' '
end;
jumlahbayar := (jumlah * harga)-round(diskon);
clrscr;
writeln('Terimakasih Telah Belanja di Konter Kami');
writeln;
write('note : ');
writeln;
writeln('Nama Operator = ', op);
writeln('Jumlah Bayar = Rp.', jumlahbayar);
writeln('bonus = ', bonus);
writeln;
write('uang anda Rp.');readln(bayar);
writeln('');
kembali:= bayar - jumlahbayar;
writeln('');
writeln('kembali Rp.',kembali);
writeln('');
writeln('periksa uang kembalian anda');
writeln('kami tidak menerima komplain apabila anda telah meninggalkan kasir');
writeln('terima kasih');
readln;
end.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment