{ PROGRAM TOTAL KONSEP .... GAJI }
uses wincrt;
VAR
NAMA, GOL, ST : ARRAY[1..10] OF STRING;
JA : ARRAY[1..10] OF INTEGER;
TMP : STRING;
GP, JML_DT, N, X, Y : INTEGER;
TI, TA, GB : REAL;
KODE: STRING;
STGP, TOTAL : REAL;
begin
NAMA[1] := 'ADI'; GOL[1]:='2A'; ST[1]:='N'; JA[1]:=8;
NAMA[2] := 'JOKO'; GOL[2]:='1B'; ST[2]:='B'; JA[2]:=0;
NAMA[3] := 'SUSI'; GOL[3]:='1A'; ST[3]:='N'; JA[3]:=0;
NAMA[4] := 'RUDI'; GOL[4]:='1A'; ST[4]:='N'; JA[4]:=1;
NAMA[5] := 'TATI'; GOL[5]:='1B'; ST[5]:='N'; JA[5]:=2;
NAMA[6] := 'ITA'; GOL[6]:='2A'; ST[6]:='N'; JA[6]:=2;
{PROSES URUTKAN DATA}
JML_DT :=6;
FOR X:=1 TO JML_DT - 1 DO
BEGIN
FOR Y:=X+1 TO JML_DT DO
BEGIN
IF GOL[X]>GOL[Y] THEN
BEGIN
TMP:=GOL[X]; GOL[X]:=GOL[Y]; GOL[Y]:=TMP;
TMP:=NAMA[X]; NAMA[X]:=NAMA[Y]; NAMA[Y]:=TMP;
TMP:=ST[X]; ST[X]:=ST[Y]; ST[Y]:=TMP;
N:=JA[X]; JA[X]:=JA[Y]; JA[Y]:=N;
END;
END;
END;
WRITELN(' LAPORAN DAFTAR GAJI ');
WRITELN(' PT. INDOKU ');
WRITELN('=================================================================');
WRITELN('NO. NAMA GOL STATUS JA GP TI TA GB ') ;
WRITELN('=================================================================');
STGP :=0;
TOTAL :=0;
KODE := GOL[1];
FOR N:=1 TO JML_DT DO
BEGIN
IF GOL[N] = '1A' THEN
GP := 100
ELSE
BEGIN
IF GOL[N] = '1B' THEN
GP :=150
ELSE
BEGIN
IF GOL[N] = '2A' THEN
GP := 200
ELSE
GP := 250;
END;
END;
{ HITUNG TUNJANGAN ISTRI}
IF ST[N]='N' THEN
TI :=15/100*GP
ELSE
TI:=0;
IF JA[N]>3 THEN
TA := 10/100*GP * 3
ELSE
TA := 10/100*GP*JA[N];
GB := GP + TI + TA;
IF GOL[N] <> KODE THEN
BEGIN
WRITELN('_________________________________________________________________');
WRITELN('SUB TOTAL : ',STGP:8:0);
WRITELN('_________________________________________________________________');
KODE := GOL[N];
STGP:=0;
END;
STGP :=STGP + GP;
TOTAL := TOTAL + GP;
WRITELN(N:3,NAMA[N]:10,GOL[N]:4,ST[N]:6,JA[N]:8,GP:8,TI:8:0,TA:8:0,GB:8:0);
END;
WRITELN('_____________________________________________________________________');
WRITELN('SUB TOTAL : ',STGP:8:0);
WRITELN('_____________________________________________________________________');
WRITELN('TOTAL GAJI : ', TOTAL:8:0);
end.
Tidak ada komentar:
Posting Komentar