Program PegawaiMemakai Procedure
Program
DataPegawai;
Uses Wincrt;
Var
nama
:array[1..100]of string;
kerja:array
[1..100]of char;
nip, gol, jam,
Gapok, Insentif, Gaber :array[1..100]of longint;
a,n,gaji:longint;
ulang,kembali:char;
proceduregaris;
begin
writeln('================================================================================');
end;
procedurenamapegawai;
begin
If
(nip[n]) = 1 then
begin
nama[n] :=
'YosepDwiAnjani';
Writeln('Nama
: ', (nama[n]));
end
else if
(nip[n]) = 2 then
begin
nama[n] :=
'RisalAgustian';
Writeln('Nama
: ', (nama[n]));
end
else if
(nip[n]) = 3 then
begin
nama[n] :=
'IdhamHanif N';
Writeln('Nama
: ', (nama[n]));
end
else
begin
write('Nama
: ');readln(nama[n]);
end;
end;
proceduregolongan;
begin
If
(gol[n]) = 1 then
Gapok[n]:=
1000000
else if (gol[n])
= 2 then
Gapok[n]:=1500000
else if
(gol[n]) = 3 then
Gapok[n]:=2000000
Else
begin
Gapok[n]:=0;
writeln('golongan
yang andamasukantidakada');
readkey;
donewincrt;
end;
end;
procedurelembur;
begin
ifupcase(kerja[n])
='Y' then
begin
Write('Lama KerjaTambahan
(jam) : ');Readln(jam[n]);
if (jam[n])
>20 then
Insentif[n]:=(jam[n])*20000
else
if
(jam[n])>=10 then
insentif[n]
:=(jam[n])*10000
else
Insentif[n]:=(jam[n])*5000;
Writeln('Insentif
: Rp. ',(insentif[n]));
Gaber[n]:=Gapok[n]+Insentif[n]
;
end
else
begin
gaber[n]:=Gapok[n];
jam[n]:=0;
insentif[n]:=0;
end;
end;
procedurelaporan;
begin
clrscr;
writeln('Laporan
Data PegawaidanGajiPegawai ');
garis;
writeln('|
|
|
| |
|
|
| | ');
writeln('| No
| NIP | NamaPegawai |Gol|GajiPokok|JamLembur|Insentif |GajiBersih|
');
writeln('|
|
|
| |
|
|
| | ');
garis;
writeln;
for a:=1 to n
do
begin
gotoxy(1,a+7);write('|');
gotoxy(3,a+7);write(a);
gotoxy(6,a+7);write('|');
gotoxy(8,a+7);write(nip[a]);
gotoxy(12,a+7);write('|');
gotoxy(13,a+7);write(nama[a]);
gotoxy(29,a+7);write('|');
gotoxy(31,a+7);write(gol[a]);
gotoxy(33,a+7);write('|');
gotoxy(34,a+7);write(gapok[a]);
gotoxy(44,a+7);write('|');
gotoxy(45,a+7);write(jam[a]);
gotoxy(55,a+7);write('|');
gotoxy(56,a+7);write(insentif[a]);
gotoxy(65,a+7);write('|');
gotoxy(68,a+7);write(gaber[a]);
gotoxy(77,a+7);write('|');
gaji:=gaji+(gaber[a]);
end;
writeln;
writeln;
writeln ('
Total GajiPegawai Yang Harus Di bayaradalahRp. ',gaji);
readln;
end;
procedureutama;
begin
n:=0;
repeat
n:=n+1;
Clrscr;
gotoxy(28,2);Writeln('SelamatDatang');
gotoxy(20,3);Writeln('Entri
Data PegawaiKelompok 3');
garis;
Writeln;
Write('NIP :
');Readln(nip[n]);
namapegawai;
Write('Golongan
(1,2,3): ');Readln(gol[n]);
golongan;
writeln('GajiPokok
: Rp. ', Gapok[n]);
write('Ada
KerjaTambahan y/t? ');readln(kerja[n]);
lembur;
Writeln('GajiBersih
: Rp. ', (Gaber[n]));
write('Tambah
data Pegawai (y/t): ');readln(ulang);
untilupcase(Ulang)
<> 'Y';
end;
begin
kembali:='Y'
;
whileupcase(kembali)
= 'Y' do
begin
gaji:=0;
utama;
laporan;
write('inginulangiAplikasi(y/t)
? ');readln(kembali);
ifupcase(kembali)='T'
then
donewincrt;
end;
end.
Program PegawaiMemakaiIf
Program
DataPegawai;
Uses Wincrt;
Var
nama
:array[1..100]of string;
kerja:array
[1..100]of char;
nip, gol, jam,
Gapok, Insentif, Gaber :array[1..100]of longint;
a,n,gaji:longint;
ulang,kembali:char;
proceduregaris;
begin
writeln('================================================================================');
end;
begin
kembali:='Y'
;
whileupcase(kembali)
= 'Y' do
begin
gaji:=0;
n:=0;
repeat
n:=n+1;
Clrscr;
gotoxy(28,2);Writeln('SelamatDatang');
gotoxy(20,3);Writeln('Entri
Data PegawaiKelompok 3');
garis;
Writeln;
Write('NIP :
');Readln(nip[n]);
If (nip[n]) = 1 then
begin
nama[n] :=
'YosepDwiAnjani';
Writeln('Nama
: ', (nama[n]));
end
else if
(nip[n]) = 2 then
begin
nama[n] :=
'RisalAgustian';
Writeln('Nama
: ', (nama[n]));
end
else if
(nip[n]) = 3 then
begin
nama[n] :=
'IdhamHanif N';
Writeln('Nama
: ', (nama[n]));
end
else
begin
write('Nama
: ');readln(nama[n]);
end;
Write('Golongan
(1,2,3): ');Readln(gol[n]);
If (gol[n]) = 1 then
Gapok[n]:=
1000000
else if
(gol[n]) = 2 then
Gapok[n]:=1500000
else if
(gol[n]) = 3 then
Gapok[n]:=2000000
Else
begin
Gapok[n]:=0;
writeln('golongan
yang andamasukanTidakada');
readkey;
donewincrt;
end;
writeln('GajiPokok
: Rp. ', Gapok[n]);
write('Ada
KerjaTambahan y/t? ');readln(kerja[n]);
ifupcase(kerja[n])
='Y' then
begin
Write('Lama
KerjaTambahan (jam) : ');Readln(jam[n]);
if (jam[n])
>20 then
Insentif[n]:=(jam[n])*20000
else
if (jam[n])
>=10 then
insentif[n]
:=(jam[n])*10000
else
Insentif[n]:=(jam[n])*5000;
Writeln('Insentif
: Rp. ',(insentif[n]));
Gaber[n]:=Gapok[n]+Insentif[n]
;
end
else
begin
gaber[n]:=Gapok[n];
jam[n]:=0;
insentif[n]:=0;
end;
Writeln('GajiBersih
: Rp. ', (Gaber[n]));
write('Tambah
data Pegawai (y/t): ');readln(ulang);
untilupcase(Ulang)
<> 'Y';
clrscr;
writeln('Laporan
Data PegawaidanGajiPegawai ');
garis;
writeln('|
|
|
| |
|
|
| | ');
writeln('| No
| NIP | NamaPegawai |Gol|GajiPokok|JamLembur|Insentif |GajiBersih|
');
writeln('|
|
|
| |
|
|
| | ');
garis;
writeln;
for a:=1 to n
do
begin
gotoxy(1,a+7);write('|');
gotoxy(3,a+7);write(a);
gotoxy(6,a+7);write('|');
gotoxy(8,a+7);write(nip[a]);
gotoxy(12,a+7);write('|');
gotoxy(13,a+7);write(nama[a]);
gotoxy(29,a+7);write('|');
gotoxy(31,a+7);write(gol[a]);
gotoxy(33,a+7);write('|');
gotoxy(34,a+7);write(gapok[a]);
gotoxy(44,a+7);write('|');
gotoxy(45,a+7);write(jam[a]);
gotoxy(55,a+7);write('|');
gotoxy(56,a+7);write(insentif[a]);
gotoxy(65,a+7);write('|');
gotoxy(68,a+7);write(gaber[a]);
gotoxy(77,a+7);write('|');
gaji:=gaji+(gaber[a]);
end;
writeln;
writeln;
writeln ('
Total GajiPegawai Yang Harus Di bayaradalahRp. ',gaji);
readln;
write('inginulangiAplikasi(y/t)
? ');readln(kembali);
ifupcase(kembali)='T'
then
donewincrt;
end;
end.
flowchat memakai if
flowchat memakai procedure