PROGRAM RONI;
USES WINCRT;
TYPE PENGIRIMAN =RECORD
NP,KP,JP :STRING[20];
BERAT,TK,T:INTEGER;
TARIF,BIAYA,BE,TTL:REAL;

END;

DATAPENGIRIMAN = ARRAY [1..100] OF PENGIRIMAN;

VAR
DATA : DATAPENGIRIMAN;
B,I,N  : INTEGER;
GT   : REAL;
JWB : CHAR;
LABEL ULANG;
PROCEDURE INPUT;
{SUBPROGRAM UNTUK PEMASUKAN DATA}
BEGIN
CLRSCR;
GOTOXY (30,02);WRITELN(‘ PROSES INPUT DATA’);
GOTOXY (30,03);WRITELN(‘<== *********** ==>’);
WRITE(‘ JUMLAH DATA => ‘); READLN(N);
FOR I:=1 TO N DO
WITH DATA[I] DO
BEGIN
WRITELN;
WRITELN(‘ * DATA KE => ‘,I);
WRITE(‘   NAMA PENGIRIM                  : ‘);READLN(NP);
WRITE(‘   KODE PAKET [KL-20/PT-15/BS-10] : ‘);READLN(KP);
WRITE(‘   BERAT PAKET                    : ‘);READLN(BERAT);
WRITELN;
END;
END;

PROCEDURE TAMPIL;
{SUBPROGRAM UNTUK MEMPROSES DAN MENAMPILKAN DATA}
BEGIN
CLRSCR;
GOTOXY (30,02);WRITE(‘ PENGIRIMAN SEJAHTERA’);
GOTOXY (30,03);WRITE(‘<=== ************ ===>’);
GOTOXY (02,04);WRITE(‘NIM        : 3101-1101-1854’);
GOTOXY (02,05);WRITE(‘CREATED BY : RONI’);
WRITELN;
WRITELN(‘ =============================================================================’);
WRITELN(‘ NO  KODE    NAMA        BERAT  JENIS    TARIF      BIAYA     BIAYA    TOTAL  ‘);
WRITELN(‘     PAKET   PENGIRIM    PAKET  PAKET    KIRIM      PAKET     EKSTRA   BIAYA  ‘);
WRITELN(‘ =============================================================================’);
{234567890123456789012345678901234567890123456789012345678901234567890123}
B:=10;

FOR I:=1 TO N DO
WITH DATA[I] DO
BEGIN

IF (COPY(KP,1,2))=’KL’ THEN
JP:=’KILAT’
ELSE IF (COPY(KP,1,2))=’PT’ THEN
JP:=’PATAS’
ELSE IF (COPY(KP,1,2))=’BS’ THEN
JP:=’BIASA’;

VAL(COPY(KP,4,2),TK,T);
TARIF:=TK*1000;

BIAYA:=BERAT*TARIF;
IF BERAT>15 THEN BE:=0.02*BIAYA ELSE BE:=0;
TTL:=BIAYA+BE;

GOTOXY(02,B);WRITE(I);
GOTOXY(14,B);WRITE(NP);
GOTOXY(06,B);WRITE(KP);
GOTOXY(26,B);WRITE(BERAT);
GOTOXY(33,B);WRITE(JP);
GOTOXY(42,B);WRITE(TARIF:6:0);
GOTOXY(53,B);WRITE(BIAYA:6:0);
GOTOXY(63,B);WRITE(BE:6:0);
GOTOXY(72,B);WRITE(TTL:6:0);
B:=B+1;
GT:=GT+TTL;
END;

GOTOXY(02,B);WRITE(‘=============================================================================’);
GOTOXY(02,B+1);WRITE(‘GRAND TOTAL : ‘);
GOTOXY(71,B+1);WRITE(GT:7:0);
GOTOXY(02,B+2);WRITE(‘=============================================================================’);
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

END.