program data_pegawai;
uses crt;
type
pegawai = record
nip : string[15];
nama : string[30];
golongan : char;
jamKerja : real;
end;
var
data : array [1..100] of pegawai;
i,n : integer;
gapok,insentif,gaber,tot,rata : real;
u1 : char;
begin
repeat
clrscr;
writeln('entry data pegawai');
writeln('===================');
writeln;
write(' masukkan jumlah data pegawai : ');readln(n);
for i :=1 to n do
begin
write('nip :'); readln(data[i].nip);
write('nama :'); readln(data[i].nama);
write('golongan :'); readln(data[i].golongan);
write('jam kerja :'); readln(data[i].jamKerja);
writeln;
end;
clrscr;
writeln('laporan gaji pegawai');
writeln('gaji PT.XYZ');
writeln;
writeln('=============================================================================');
writeln('| nip | nama | golongan | jam Kerja | gaji |');
writeln('=============================================================================');
for i := 1 to n do
begin
case data[i].golongan of
'1' : gapok :=1000000;
'2' : gapok :=1500000;
'3' : gapok :=2000000;
else
gapok :=0;
end;
if data[i].jamKerja > 200 then
insentif := (data[i].jamKerja - 200)*10000
else
insentif :=0;
gaber := gapok + insentif;
tot := tot + gaber;
writeln('|',data[i].nip:13,'|',data[i].nama:14,'|',data[i].golongan:14,'|',data[i].jamKerja:15:0,'|',gaber:14:2,'|');
end;
rata := tot/n;
writeln('=============================================================================');
writeln;
writeln('total gaji keseluruhan : Rp.',tot:12:0);
writeln('rata gaji pegawai : Rp.',rata:12:0);
writeln;
write('mau ulang lagi ? [Y/T] :'); readln(u1);
until upcase(u1) <> 'Y';
end.
uses crt;
type
pegawai = record
nip : string[15];
nama : string[30];
golongan : char;
jamKerja : real;
end;
var
data : array [1..100] of pegawai;
i,n : integer;
gapok,insentif,gaber,tot,rata : real;
u1 : char;
begin
repeat
clrscr;
writeln('entry data pegawai');
writeln('===================');
writeln;
write(' masukkan jumlah data pegawai : ');readln(n);
for i :=1 to n do
begin
write('nip :'); readln(data[i].nip);
write('nama :'); readln(data[i].nama);
write('golongan :'); readln(data[i].golongan);
write('jam kerja :'); readln(data[i].jamKerja);
writeln;
end;
clrscr;
writeln('laporan gaji pegawai');
writeln('gaji PT.XYZ');
writeln;
writeln('=============================================================================');
writeln('| nip | nama | golongan | jam Kerja | gaji |');
writeln('=============================================================================');
for i := 1 to n do
begin
case data[i].golongan of
'1' : gapok :=1000000;
'2' : gapok :=1500000;
'3' : gapok :=2000000;
else
gapok :=0;
end;
if data[i].jamKerja > 200 then
insentif := (data[i].jamKerja - 200)*10000
else
insentif :=0;
gaber := gapok + insentif;
tot := tot + gaber;
writeln('|',data[i].nip:13,'|',data[i].nama:14,'|',data[i].golongan:14,'|',data[i].jamKerja:15:0,'|',gaber:14:2,'|');
end;
rata := tot/n;
writeln('=============================================================================');
writeln;
writeln('total gaji keseluruhan : Rp.',tot:12:0);
writeln('rata gaji pegawai : Rp.',rata:12:0);
writeln;
write('mau ulang lagi ? [Y/T] :'); readln(u1);
until upcase(u1) <> 'Y';
end.
No comments:
Post a Comment