program pembelian_mebel;
uses
wincrt;
var
no,nm_pembeli,nm_mebel,warna:string;
kd_mebel,kd_warna,j:char;
harga:longint;
jml_beli,bayar,diskon,total:real;
begin
j:='Y';
repeat
clrscr;
gotoxy(34,5);writeln('Toko Mebel Angkasa');
gotoxy(40,6);writeln('Pati');
gotoxy(29,7);writeln('============================');
gotoxy(29,8);write('No Transaksi = ');readln(no);
gotoxy(29,9);write('Nama Pembeli = ');readln(nm_pembeli);
gotoxy(29,10);write('Kode Mebel = ');readln(kd_mebel);
gotoxy(29,11);write('Kode Warna = ');readln(kd_warna);
gotoxy(29,12);write('Jumlah Beli = ');readln(jml_beli);
gotoxy(29,13);writeln('============================');
case upcase(kd_mebel) of
'A':begin
nm_mebel:='Almari';
harga:=600000;
end;
'M':begin
nm_mebel:='Meja Belajar';
harga:=500000;
end;
'K':begin
nm_mebel:='Meja Komputer';
harga:=400000;
end;
end;
if kd_warna='1'then warna:='Merah'
else if kd_warna='2'then warna:='Biru'
else
warna:='hijau';
bayar:=harga*jml_beli;
if jml_beli>5 then diskon:=0.15*bayar
else
diskon:=0;
total:=bayar-diskon;
gotoxy(29,14);writeln('Nama Mebel = ',nm_mebel);
gotoxy(29,15);writeln('Harga = Rp_',harga);
gotoxy(29,16);writeln('Warna = ',warna);
gotoxy(29,17);writeln('============================');
gotoxy(29,18);writeln('Bayar = Rp ',bayar:10:2);
gotoxy(29,19);writeln('Diskon = Rp ',diskon:6:2);
gotoxy(29,20);writeln('Total = Rp ',total:8:2);
gotoxy(29,21);writeln('============================');
gotoxy(29,22);writeln('Terimakasih atas kunjungannya');
gotoxy(29,23);writeln(‘Anda Puas Kami Senang’);
gotoxy(29,24);write('Coba lagi(Y/T)=');readln(j);
until upcase(j)='T';
readkey;
end.
0 comments:
Speak up your mind
Tell us what you're thinking... !