PROGRAM TUGAS_8A;
{NIM      : 3101-1101-1854}
{NAMA     : RONI}
USES WINCRT;
VAR
KODE                     :ARRAY[1..100] OF CHAR;
NAMA,PR,MERK             :ARRAY[1..100] OF STRING[20];
JML,NO                   :ARRAY[1..100] OF BYTE;
HRG,PJK,DIS, TTL         :ARRAY[1..100] OF REAL;
I,R,B    :INTEGER;
JWB      :CHAR;
GT       :REAL;
LABEL ULANG,SELESAI;

PROCEDURE INPUT;
BEGIN
CLRSCR;
GOTOXY (25,02);WRITELN(‘ <== PROSES INPUT DATA ==> ‘);
WRITELN;
WRITE(‘JUMLAH DATA      => ‘);READLN(R);
FOR I:= 1 TO R DO

BEGIN
WRITELN;
WRITELN(‘* DATA KE  -> ‘,I);
WRITELN;
WRITE(‘  NO  TRANSAKSI                : ‘);READLN(NO[I]);
WRITE(‘  NAMA TOKO                    : ‘);READLN(NAMA[I]);
WRITE(‘  KODE JAM     [A/C/S]         : ‘);READLN(KODE[I]);
WRITE(‘  PRODUKSI     [LOKAL/IMPORT]  : ‘);READLN(PR[I]);
WRITE(‘  JUMLAH BELI                  : ‘);READLN(JML[I]);
END;
END;

PROCEDURE TAMPIL;
BEGIN
CLRSCR;
GOTOXY (30,02);WRITELN(‘  CARDIFF COLECTION ‘);
GOTOXY (30,03);WRITELN(‘<=== *********** ===>’);
GOTOXY (02,04);WRITE(‘NIM        : 3101-1101-1854’);
GOTOXY (02,05);WRITE(‘CREATED BY : RONI’);
WRITELN;
WRITELN(‘ ==============================================================================’);
WRITELN(‘ NO   NAMA     KODE  MERK    PRODUKSI HARGA    JUMLAH  PAJAK   DISKON   TOTAL’);
WRITELN(‘      TOKO     JAM   JAM              JAM      BELI                     BAYAR’);
WRITELN(‘ ==============================================================================’);
{12345678901234567890123456789012345678901234567890123456789012345678901234567}
B:=10;
FOR I:= 1 TO R DO
BEGIN
CASE KODE[I] OF
‘S’,’s’   :MERK[I]:=’SWISS’;
‘A’,’a’   :MERK[I]:=’ARMY’;
‘C’,’c’   :MERK[I]:=’CARDIFF’;
END;

IF (MERK[I]=’SWISS’) AND (PR[I]=’IMPORT’) THEN
HRG[I]:=150000
ELSE IF(MERK[I]=’SWISS’) AND (PR[I]=’LOKAL’) THEN
HRG[I]:=140000
ELSE IF(MERK[I]=’ARMY’) AND (PR[I]=’IMPORT’) THEN
HRG[I]:=65000
ELSE IF(MERK[I]=’ARMY’) AND (PR[I]=’LOKAL’) THEN
HRG[I]:=50000
ELSE IF(MERK[I]=’CARDIFF’) AND (PR[I]=’IMPORT’) THEN
HRG[I]:=120000
ELSE IF(MERK[I]=’CARDIFF’) AND (PR[I]=’LOKAL’) THEN
HRG[I]:=100000;

IF PR[I]=’IMPORT’ THEN PJK[I]:=0.1*(HRG[I]*JML[I]) ELSE PJK[I]:=0;

IF JML[I]>100 THEN DIS[I]:=0.2*(HRG[I]*JML[I]) ELSE DIS[I]:=0;

TTL[I]:=(HRG[I]*JML[I])+PJK[I]-DIS[I];

GOTOXY(02,B);WRITE(I);
GOTOXY(07,B);WRITE(NAMA[I]);
GOTOXY(16,B);WRITE(KODE[I]);
GOTOXY(22,B);WRITE(MERK[I]);
GOTOXY(30,B);WRITE(PR[I]);
GOTOXY(39,B);WRITE(HRG[I]:6:0);
GOTOXY(48,B);WRITE(JML[I]);
GOTOXY(56,B);WRITE(PJK[I]:5:0);
GOTOXY(64,B);WRITE(DIS[I]:5:0);
GOTOXY(72,B);WRITE(TTL[I]:7:0);
B:=B+1;
GT:=GT+TTL[I];

END;
GOTOXY (02,B);WRITELN(‘==============================================================================’);
GOTOXY (02,B);WRITELN(‘ GRAND TOTAL  : ‘,’                                                    ‘,GT:10:0);
GOTOXY (02,B);WRITELN(‘ ==============================================================================’);
END;

{PROGRAM UTAMA}
BEGIN
ULANG:
INPUT;
TAMPIL;

GOTOXY (55,23);WRITE(‘ULANG LAGI [Y/T] : ‘);READLN(JWB);
IF (JWB=’Y’) OR (JWB=’y’) THEN GOTO ULANG
ELSE GOTO SELESAI;

SELESAI:
CLRSCR;
GOTOXY (20,12);WRITE(‘<=”TERIMA KASIH ATAS KUNJUNGAN ANDA”=>’);
GOTOXY (20,14);WRITE(‘        => CARDIFF COLECTION <=’);

END.