Monday, 27 February 2012

Program Kasir/Penjualan di paskal

code ini adalah rpogram kasir/penjualan,, silakan copy codenya di bawah ini :

uses wincrt;

label kembali;

type data=array[1..100] of string;

jml =array[1..100] of integer;

var n,i :integer;

barang :data;

harga :jml;

total :integer;

bayar :integer;

total2 :integer;

begin

kembali:writeln;

clrscr;

writeln('nama : mohamad echa putra ');

writeln('nim : A2.1100133');

gotoxy(25,4);writeln('PROGRAM KASIR');

gotoxy(19,5);writeln('===================================');

gotoxy(20,7);write('jumlah barang yang di beli : ');readln(n);

i:=0;

for i:=1 to n do

begin

writeln;

write('nama barang ',i,' : ');readln(barang[i]);

write('harga ',i,' : ');readln(harga[i]);

end;

clrscr;

gotoxy(20,1);writeln('========================================');

gotoxy(20,2);writeln('NAMA BARANG |HARGA |');

gotoxy(20,3);WRITELN('========================================');

for i:=1 to n do

begin

writeln(barang[i]:25,' |',harga[i]:10);

WRITELN(' _________________________________________________');

total:=total+harga[i];

end;

writeln('total : ':30,total);

write('pembayaran : ');readln(bayar);

if ( bayar>total) then

begin

total2:=bayar-total;

writeln('jumlah uang pengembalian = ',total2);

writeln('teimakasih');

readln;

goto kembali;

end

else if (bayar=total) then

begin

writeln('terimakasih');

readln;

goto kembali;

end

else if (bayar

begin

writeln('maaf uang yang anda kasih tidak cukup untuk membeli produk yang di jual oleh kami');

readln;

goto kembali;

end;

end.


selamat mencoba...:)

0 komentar:

Post a Comment