program perocedure

USES CRT ;

Type produk::record

Kode:string[3]

Jumlah:byte;

End;

VAR

Pil:byte;

rproduk   : Array[1..10] of produk;

Jumlah : byte;

Nama   : String[20] ;

Harga  : Longint;

Total  : Longint ;

SubTotal : Longint ;

Lagi   : Char;

i,j    : byte;

procedure infut;

BEGIN

Writeln(‘bagian infut’);/

begin

REPEAT

            Inc(i);

Textcolor(12); textbackground(1);

Clrscr;

Gotoxy (30, 5) ; Write(‘kode::’); readln (‘produk[j].kode);

Gotoxy (30, 6) ; Write(‘jumlah:’); readln(rproduk[j]jumlah);

Write(‘infut lagi [lg/j]; readln(lg);

Until lg in [‘t’t’];

End;

Procedure outfut;

Begin

            Writeln(‘bagian utfut’);

            Clrscr;

            Gotoxy(23,4); write(‘laporan penjualan barang elektronik’);

            Gotoxy( 20,5);write(‘+—+——+—————–+——+———+———-+’);

Gotoxy( 20,6);write(‘|No | Kode | Nama Produk     |Jumlah|  Harga  |   Total  |’);

Gotoxy( 20,8);write(‘+—+——+—————–+——+———+———-+’);

            FOR j:= 1 to i do

BEGIN

If rproduk[j].kode = ’001′ then

BEGIN

Nama := ‘tv’; Harga := 100000;

END

ELSE IF rproduk[j].kode = ’002′ Then

BEGIN

Nama := ‘dvd’; Harga := 650000;

END

Total:=harga*rproduk[i]*jumlah;

Gotoxy(20,9+j); write(j:),rproduk[j].kode:7,nama:7,rproduk[j].kode:2 rproduk[j].jumlah:5,total:(0);

end;

            gotoxy(20,10+j); write(‘________________________________________’);

end;

begin

clrscr;

bil:=I;

repeat

            writelnln(‘menu’);

writeln(‘1.input data’);

writeln(‘2.utput data’);

writeln(‘3.keluar’);

writeln(‘pilihan:’);

            readln(pil);

case pil of

                        1.input;

                        2.output;

End;

Readln;

Until (pil:3);

End.

About boruhasibuan

sabar, berjuang, dan semangat yg disertai kemauan dan do'a dlm menghadapi sgala sesuatu hal, ini-lah yg selalu ada dlm pikiran-Q, berjuang dan berjuang!!!!
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s