program pembuatan_record;
uses crt;
procedure garis;
begin
writeln(’==============================================’);
end;
type
reckaryawan=record
jab,nip,nama:string;
gol:integer;
gapok,tunj:real;
end;
var pegawai:reckaryawan;
total:real;
begin
clrscr;
writeln(’ LAPORAN PERHITUNGAN GAJI KARYAWAN PT MAJU TAK GENTAR’);
garis;
writeln;
write(’Masukan NIP Karyawan : ‘);readln(pegawai.nip);
write(’Masukan Nama Karyawan : ‘);readln(pegawai.nama);
write(’Golongan[1/2/3] : ‘);readln(pegawai.gol);
garis;
case pegawai.gol of
1:
begin
pegawai.jab:=’Staf dan Tetap’;
pegawai.gapok:=900000;
end;
2:
begin
pegawai.jab:=’Staf dan Kontrak’;
pegawai.gapok:=700000;
end;
3:
begin
pegawai.jab:=’Kontrak’;
pegawai.gapok:=500000;
end;
end;
if pegawai.jab=’Staf dan Tetap’ then
pegawai.tunj:=25/100*pegawai.gapok
else
if pegawai.jab=’Staf dan Kontrak’ then
pegawai.tunj:=10/100*pegawai.gapok
else
pegawai.tunj:=0;
total:=(pegawai.gapok)+(pegawai.tunj);
writeln(’Jabatan Karyawan : ‘,pegawai.jab);
writeln(’Gaji Pokok : ‘,pegawai.gapok:8:0);
writeln(’Tunjangan : ‘,pegawai.tunj:8:0);
garis;
writeln(’Total Gaji Karyawan : ‘,total:8:0);
readln;
end.
uses crt;
procedure garis;
begin
writeln(’==============================================’);
end;
type
reckaryawan=record
jab,nip,nama:string;
gol:integer;
gapok,tunj:real;
end;
var pegawai:reckaryawan;
total:real;
begin
clrscr;
writeln(’ LAPORAN PERHITUNGAN GAJI KARYAWAN PT MAJU TAK GENTAR’);
garis;
writeln;
write(’Masukan NIP Karyawan : ‘);readln(pegawai.nip);
write(’Masukan Nama Karyawan : ‘);readln(pegawai.nama);
write(’Golongan[1/2/3] : ‘);readln(pegawai.gol);
garis;
case pegawai.gol of
1:
begin
pegawai.jab:=’Staf dan Tetap’;
pegawai.gapok:=900000;
end;
2:
begin
pegawai.jab:=’Staf dan Kontrak’;
pegawai.gapok:=700000;
end;
3:
begin
pegawai.jab:=’Kontrak’;
pegawai.gapok:=500000;
end;
end;
if pegawai.jab=’Staf dan Tetap’ then
pegawai.tunj:=25/100*pegawai.gapok
else
if pegawai.jab=’Staf dan Kontrak’ then
pegawai.tunj:=10/100*pegawai.gapok
else
pegawai.tunj:=0;
total:=(pegawai.gapok)+(pegawai.tunj);
writeln(’Jabatan Karyawan : ‘,pegawai.jab);
writeln(’Gaji Pokok : ‘,pegawai.gapok:8:0);
writeln(’Tunjangan : ‘,pegawai.tunj:8:0);
garis;
writeln(’Total Gaji Karyawan : ‘,total:8:0);
readln;
end.
Program DataPegawai;
Uses Wincrt;
Type Pegawai = record
NIP : String[9];
Nama : String[50];
Golongan : Char;
Jamkerja : Real;
End;
Var
Data : Pegawai;
Gapok : Real;
Insentif,Gaber : Real;
Ul : Char;
Begin
Repeat
Clrscr;
Writeln('Entry Data Pegawai PT. Punya gua');
Writeln('==========================');
Writeln;
Write('NIP : ');Readln(Data.NIP);
Write('Nama : ');Readln(Data.Nama);
Write('Golongan : ');Readln(Data.Golongan);
Write('Jam Kerja : ');Readln(Data.Jamkerja);
Writeln;
Writeln;
Case Data.Golongan of
'1' : Gapok:=1000000;
'2' : Gapok:=1500000;
'3' : Gapok:=2000000;
Else
Gapok:=0;
End;
if Data.Jamkerja>200 then
Insentif:=(Data.Jamkerja-200)*10000
else
Insentif:=0;
Gaber:=Gapok+Insentif;
Clrscr;
Writeln('Laporan Gaji Pegawai');
Writeln('PT. XYZ');
Writeln;
Writeln('============================================================================');
Writeln('|NIP | Nama | Golongan | Jam Kerja | Gaji |');
Writeln('============================================================================');
Writeln('|',Data.NIP:10,'|',Data.Nama:25,'|',Data.Golongan:10,'|',Data.Jamkerja:11:0,'|',Gaber:14:2,'|');
Writeln('============================================================================');
Writeln;
Write('Mau Ulang Lagi? [Y/T]: ');Readln(Ul);
Until Upcase(Ul) <> 'Y';
End.
0 komentar