program sederhana turbo pascal
Program Gaji_Tunjangan_dan_Pajak;
{Menghitung jumlah gaji berdasarkan golongan, tunjangan anak dan istri, total gaji setelah pajak}
Uses wincrt;
var
nama,jab : string[20];
noin : string[10];
golgaj : char;
stmerit, jmlanak : integer;
gaj,tjbini,tjanak,pajgaj,jmlpajgaj,jmltjgaj,tolgaj,tolgajstpaj : real;
Begin
clrscr;
Writeln ('=============================================');
Writeln ('PERHITUNGAN GAJI DAN TUNJANGAN DAN PAJAK GAJI');
Writeln ('=============================================');
Writeln;
Writeln ('Isikan Data anda sesuai ketentuan berikut ini : ');
Writeln ('----------------------------------------------- ');
Writeln;
Writeln ('Golongan Gaji : Status Perkawinan : ');
Writeln ('a. Rp. 2.000.000.00 1. Kawin ');
Writeln ('b. Rp. 2.500.000.00 2. Belum kawin');
Writeln ('c. Rp. 3.000.000.00 3. Cerai ');
Writeln;
Write ('Masukkan No karyawan : ');readln (noin);
Write ('Masukkan nama anda : ');readln (nama);
Write ('Masukkan Jabatan : ');readln (jab);
Write ('Masukkan Golongan gaji anda : ');readln (golgaj);
case golgaj of
'a' : begin
gaj := 2000000;
pajgaj := (2/100);
Write ('Status Perkawinan anda : ');readln (stmerit);
case stmerit of
1 : begin
tjbini := (5/100)*gaj;
Write ('Jumlah anak : ');readln (jmlanak);
if jmlanak <= 3 then
tjanak := jmlanak*((2/100)*gaj)
else
tjanak := 3*((2/100)*gaj);
end;
2 : begin
tjbini := 0;
tjanak := 0;
end;
3 : begin
tjbini := 0;
Write ('Jumlah anak : ');readln (jmlanak);
if jmlanak <= 3 then
tjanak := jmlanak*((2/100)*gaj)
else
tjanak := 3*((2/100)*gaj);
end;
else
Writeln;
Writeln ('================================================================');
Writeln;
Writeln ('Tunjangan tidak terhitung karena tidak terinput dengan benar !!!');
end;
end;
'b' : begin
gaj := 2500000;
pajgaj := (2.5/100);
Write ('Status Perkawinan anda : ');readln (stmerit);
case stmerit of
1 : begin
tjbini := (5/100)*gaj;
Write ('Jumlah anak : ');readln (jmlanak);
if jmlanak <= 3 then
tjanak := jmlanak*((2/100)*gaj)
else
tjanak := 3*((2/100)*gaj);
end;
2 : begin
tjbini := 0;
tjanak := 0;
end;
3 : begin
tjbini := 0;
Write ('Jumlah anak : ');readln (jmlanak);
if jmlanak <= 3 then
tjanak := jmlanak*((2/100)*gaj)
else
tjanak := 3*((2/100)*gaj);
end;
else
writeln;
Writeln ('================================================================');
Writeln;
Writeln ('Tunjangan tidak terhitung karena tidak terinput dengan benar !!!');
end;
end;
'c' : begin
gaj := 3000000;
pajgaj := (3/100);
Write ('Status Perkawinan anda : ');readln (stmerit);
case stmerit of
1 : begin
tjbini := (5/100)*gaj;
Write ('Jumlah anak : ');readln (jmlanak);
if jmlanak <= 3 then
tjanak := jmlanak*((2/100)*gaj)
else
tjanak := 3*((2/100)*gaj);
end;
2 : begin
tjbini := 0;
tjanak := 0;
end;
3 : begin
tjbini := 0;
Write ('Jumlah anak : ');readln (jmlanak);
if jmlanak <= 3 then
tjanak := jmlanak*((2/100)*gaj)
else
tjanak := 3*((2/100)*gaj);
end;
else
writeln;
Writeln ('================================================================');
Writeln;
Writeln ('Tunjangan tidak terhitung karena tidak terinput dengan benar !!!');
end;
end;
else
Writeln;
Writeln ('=======================================');
Writeln;
Writeln ('Maaf, Golongan Gaji tidak terdaftar !!!');
Writeln;
end;
jmltjgaj := tjbini+tjanak;
tolgaj := gaj+jmltjgaj;
jmlpajgaj := tolgaj*pajgaj;
tolgajstpaj := tolgaj-jmlpajgaj;
Writeln;
Writeln ('SLIP GAJI -----------------------------------> ');
Writeln;
Writeln ('Nama : ',nama);
Writeln ('No Karyawan : ',noin);
Writeln ('Jabatan : ',jab);
Writeln ('+============================================+');
Writeln ('| Rincian | Jumlah | ');
Writeln ('+============================================+');
Writeln ('| Besar Gaji : | Rp.',gaj:8:0,' |');
Writeln ('| Tunjangan istri : | Rp.',tjbini:8:0,' |');
Writeln ('| Tunjangan anak : | Rp.',tjanak:8:0,' |');
Writeln ('| Total gaji : | Rp.',tolgaj:8:0,' |');
Writeln ('| Pajak gaji : | Rp.',jmlpajgaj:8:0,' |');
Writeln ('+----------------------------+---------------+');
Writeln ('| Total gaji setelah pajak : | Rp.',tolgajstpaj:8:0,' |');
Writeln ('+----------------------------+---------------+');
Writeln ('Program by, w1r0');
readln;
End.