Mengenai Saya

Foto saya
hallooowwww.....friend, nice to meet you.... my nime is indah I come from Pati,Semarang,Jateng,Indonesia. mmmmm...I studied in UTY Yogyakarta,Tehnology of information dept

Pengikut

Diberdayakan oleh Blogger.
RSS

Tugas Mandiri 2

uses wincrt;

type barang =record
code,nama:string;
harga:real;
satuan:string;
stok:byte;
end;

larikbar=array[1..20] of barang;
var bar:larikbar;
i,n,x:byte;
lagi:char;

begin
lagi:='y';
while lagi='y' do
begin
inc(n);
writeln('mengisi data barang ke ', n);
write('kode barang ==>');readln(bar[n].code);
write('nama barang ==>');readln(bar[n].nama);
write('harga ==>');readln(bar[n].harga);
write('satuan ==>');readln(bar[n].satuan);
writeln;write('mau masukan data barang lain?');readln(lagi);
end;

{transaksi}
writeln('mengisi stok');
for i:=1 to n do
begin
write('membeli', bar[i].nama, ' sebanyak? ');
readln(x); bar [i].stok:=x;
end;

{setak}
writeln;
writeln;
writeln(' DAFTAR STOK TOKO BAGUS ');
writeln('========================================================');
writeln(' no kode nama barang harga satuan stok ');
writeln('--------------------------------------------------------');
for i:=1 to n do with bar[i] do
writeln(i:2,code:6,nama:15,harga:12:2,satuan:8,stok:8);
writeln('---------------------------------------------------------');
{jual}
end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 komentar:

Posting Komentar