program gajiKaryawan;
uses wincrt;
var namaPeg : array[1..30] of string;
jampeg : array[1..30] of integer;
golPeg : char;
i,n:integer;
GajiTetap,GajiPerJam,gpj : longint;
upah, gajiTotal : real;
procedure pembagianGolongan(x:char);
begin
case x of
'1' : begin gajiTetap := 500000; gajiPerJam := 5000; end;
'2' : begin gajiTetap := 300000; gajiPerJam := 3000; end;
'3' : begin gajiTetap := 250000; gajiPerJam := 2000; end;
'4' : begin gajiTetap := 100000; gajiPerJam := 1500; end;
'5' : begin gajiTetap := 50000; gajiPerJam := 1000;
end else
writeln('Golongan tidak terdaftar');
end;
end;
procedure upahLembur;
begin
if(jamPeg[i]>100) then
begin
upah := (jamPeg[i] - 100) * 1.5 * gajiPerJam;
jamPeg[i] := 100;
end else
upah:=0;
gpj := jamPeg[i] * gajiPerjam;
end;
function penggajian(x : longint; y:real; z:longint): real;
begin
penggajian := x + y + z;
end;
begin
clrscr;
writeln('Selamat datang di Sistem Gaji Karyawan');
writeln('---------------------------------------');
write('Masukkan jumlah pegawai : '); readln(n);
for i:=1 to n do
begin
write('Masukkan Nama Pegawai : '); readln(namaPeg[i]);
write('Golongan : '); readln(golPeg);
write('Jam Kerja : '); readln(jamPeg[i]);
if jamPeg[i] <= 744 then
begin
pembagianGolongan(golPeg);
upahLembur;
writeln;
writeln('Nama Anda : ', namaPeg[i]);
writeln('Golongan : ',golPeg);
writeln('Gaji Tetap : Rp.', gajiTetap);
writeln('Gaji per jam : Rp.', gajiPerJam);
writeln('Gaji Kerja : Rp.', gpj);
writeln('Upah Lembur : Rp.', upah:2:0);
writeln('---------------------------------------- +');
writeln('jadi gaji anda sekarang : Rp.', penggajian(gpj,upah,gajiTetap):2:0);
end else
writeln('Jam Kerja Anda salah !!!');
end;
writeln;
writeln('Nama : YUDHA AGUNG WIRAWAN');
writeln('NIM : 118110038');
readln;
end.
Kamis, 03 November 2011
Program Gaji Karyawan Pascal
09.25
Guardian
No comments
0 komentar:
Posting Komentar