Sabtu, 16 Juni 2012

Cara Membuat Program Data Belanja Melalui TPW .1.5

TPW for Windows

Sahabat MoveOn dimanapun anda berada, kali ini saya akan share bagaimana cara membuat progam kasir melalui TPW. Ok, langsung saja...

Langkah pertama, buka TPWnya.

Langkah kedua,
Copas saja source code/ tulisan di bawah ini ke TPWnya

Program Kasir;

uses wincrt;

var nama_barang : array[1..20] of string;

harga : array[1..20] of real;

banyak : array[1..20] of byte;

kata,grs :string;

namakasir : string;
tanggal :string;

x,y,i,j :byte;

Jum_Harga,Total_Harga,disc,Total_Bayar,uang :real;

begin



clrscr;

grs:='===============================================================';


kata:='>>>>> TACKAWA STORE <<<<<';

x:=round((78-length(kata))/2);

gotoxy(x,2);writeln(kata);

x:=round((78-length(grs))/2);

gotoxy(x,3);write(grs);

{-----------------------------}

gotoxy(x,4);write('Data Belanjaan');

gotoxy(x,5);write(grs);

gotoxy(x,6);writeln('| No |   Nama Barang   | Harga Satuan | Banyak | Jumlah Harga |');

gotoxy(x,7);write(grs);

{--------------------------------------------------------------------}

i:=0;

Total_Harga:=0;

repeat

i:=i+1;

gotoxy(x,7+i);write('| ',i);

gotoxy(x+5,7+i);write('|');

gotoxy(x+7,7+i);readln(Nama_barang[i]);

if Nama_Barang[i] <>'' then begin

gotoxy(x+23,7+i);write('|');

gotoxy(x+27,7+i);readln(Harga[i]);

gotoxy(x+24,7+i);writeln(Harga[i]:10:2);

gotoxy(x+38,7+i);write('|');

gotoxy(x+42,7+i);readln(Banyak[i]);

gotoxy(x+47,7+i);write('|');

Jum_Harga:=Harga[i]*Banyak[i];

gotoxy(x+48,7+i);writeln(Jum_Harga:10:2);

gotoxy(x+62,7+i);writeln('|');

Total_Harga:=Total_Harga+Jum_Harga ; end;

until nama_barang[i]='';

{--------------------------------------------------------------------}

disc:=0;

if (Total_Harga > 10000) and (Total_Harga <100000) then

disc:=0.05 * Total_Harga

else

if (Total_Harga >= 100000 ) then

disc:=0.1 *Total_Harga;

{--------------------------------------------------------------------}

kata:='TACKAWA STORE';

y:=round((78-length(kata))/2);

gotoxy(y,2);writeln(kata);

j:=i-1;

gotoxy(x,8+j);write(grs);

gotoxy(x,8+j+1);write('Total Belanja :');

gotoxy(x+48,8+j+1);write(Total_Harga:10:2);

gotoxy(x,8+j+2);write('Discount :');

gotoxy(x+48,8+j+2);write(disc:10:2);

gotoxy(x,8+j+3);write(grs);

gotoxy(x,8+j+4);write('Total Bayar setelah discount :');

Total_Bayar:=Total_Harga-disc;

gotoxy(x+48,8+j+4);write(Total_Bayar:10:2);

gotoxy(x,8+j+5);write('Uang Pembayaran :');

gotoxy(x+48,8+j+5);readln(Uang);

gotoxy(x+48,8+j+5);writeln(Uang:10:2);

gotoxy(x,8+j+6);Write(grs);

gotoxy(x,8+j+7);write('Uang Kembali');

gotoxy(x+48,8+j+7);write(Uang-Total_Bayar:10:2);

gotoxy(x,10+j+6);Write(grs);
writeln;
writeln('       Tackawa Store');
writeln('       Jl. Raya Mantrianom 75 Bawang - Banjarnegara');
write('       Tanggal : ');readln(tanggal);
write('       Kasir : '); read(namakasir);
writeln('       ---------------------------------------------------------------');
writeln('                    "Terimakasih atas kunjungan anda :)"');

end.

Langkah terakhir, simpan kode tersebut dan jalankan.
Gambar hasil jadinya setelah di run
 
Sekian Tutorial Bagaimana cara membuat program kasir melalui TPW.
Terimakasih sudah mengunjungi Comeon-Moveon, Semoga Bermanfaat!

0 komentar:

Posting Komentar

 
Top