PROGRAM PASCAL PROCEDURE PEMBELIAN

   What's up guys balik lagi ke blog gue yang selalu ingin bantu mengerjakan tugas sist/gan yang belom kelar nihh.... langsung aja cekibroooott....!!!!!  
PASCAL IDE.

Progam Procedure_Pembelian;
USES CRT;
VAR KB, NB : ARRAY[1..10] OF STRING;
    HG, JML : ARRAY[1..10] OF LONGINT;
    ADL: CHAR;
    JD, X, BR : BYTE;
    TOTAL, DISC, PB : REAL;
BEGIN
     ADL:='Y';JD:=0;
     WHILE (ADL='Y') AND (JD<=10) DO
     BEGIN
          CLRSCR;
          GOTOXY(25,5);WRITE('ENTRY DATA PEMBELIAN');
          GOTOXY(25,6);WRITE('====================');
          JD:=JD+1;
          GOTOXY(25, 8);WRITE('KODE  BARANG :');READLN(KB[JD]);
          GOTOXY(25, 9);WRITE('NAMA  BARANG :');READLN(NB[JD]);
          GOTOXY(25,10);WRITE('HARGA BARANG :');READLN(HG[JD]);
          GOTOXY(25,11);WRITE('JUMLAH       :');READLN(JML[JD]);
          GOTOXY(25,12);WRITE('ADA DATA LAGI[Y/T] :');READLN(ADL);
     END;
CLRSCR;
GOTOXY(1,1);WRITE('LAPORAN PEMBELIAN BARANG');
GOTOXY(1,2);WRITE('TOKO AGAN KOMPUTER');
GOTOXY(1,3);WRITE('Jl. Jendral Suprapto No. 23 - Telpon (0123)');
GOTOXY(1,5);WRITE('--------------------------------------------------------------------------------------------- ');
GOTOXY(1,6);WRITE('| NO | KODE | NM BARANG | HARGA | JUMLAH |  TOTAL | DISC | PEMBAY |');
GOTOXY(1,7);WRITE('----------------------------------------------------------------------------------------------');
                                    {1234567890123456789012345678901234567890123456789012345678901234567890}
                                  
BR:=8;TOTAL:=0;
     FOR X:=1 TO JD DO
     BEGIN
          GOTOXY(1,BR);WRITE('| ', X);
          GOTOXY(6,BR);WRITE('|' , KB[X]);
          GOTOXY(13,BR);WRITE('|' , NB[X]);
          GOTOXY(27,BR);WRITE('|' , HG[X]);
          GOTOXY(35,BR);WRITE('| ', JML[X]);
          TOTAL:=HG[X]*JML[X];
          IF TOTAL>500000 THEN DISC:=0.2*TOTAL
          ELSE IF TOTAL>250000 THEN DISC:=0.15*TOTAL
          ELSE IF TOTAL>100000 THEN DISC:=0.1*TOTAL
          ELSE DISC:=0;
          PB:=TOTAL-DISC;
          GOTOXY(44,BR);WRITE('|', TOTAL:6:1);
          GOTOXY(53,BR);WRITE('|' , DISC:8:1);
          GOTOXY(64,BR);WRITE('|' , PB:9:1);
          GOTOXY(77,BR);WRITE('|');
          BR:=BR+1
     END;
 GOTOXY(1,BR);WRITE('--------------------------------------------------------------------------------------');
READKEY;

END.


OUTPUT

ENTRY DATA PEMBELIAN
====================
KODE BARANG :1234
NAMA BARANG :Hp HUAWEI
HARGA    BARANG :2500000
JUMLAH :1
ADA DATA LAGI [Y/T]    :Y



ENTRY DATA PEMBELIAN
====================
KODE BARANG :4567
NAMA BARANG :LAPTOP ACER
HARGA    BARANG :3500000
JUMLAH :1
ADA DATA LAGI [Y/T]    :T


LAPORAN PEMBELIAN BARANG
TOKO AGAN ELECTRONIC
Jl.Jendral Suprapto No.23 – Telpon (0123)
----------------------------------------------------
|NO | KODE | NM BARANG | HARGA | JUMLAH | TOTAL | DISC | PEMBAY|
---------------------------------------------------------------------------------------------------------------
| 1--|1234--|Hp HUAWEI        |2500000 | 1                |2500000.|50000.0|2000000.0|
| 2--|4567--|LAPTOP ACER  |3500000 | 1              |3500000.|70000.0|2800000.0|


SELAMAT MENGCOPY TORA CAFFE BARENG GUE.....
 SEE YOU NEXT IN MY BLOG....~~~

Komentar

Posting Komentar

Postingan populer dari blog ini

Program Pascal Menghitung Luas dan Keliling Lingkaran

Program Pascal Luas Bangun Datar

Program Pascal Menara Hanoi