uses wincrt;
var
nama,jab:string[25];
noin :string[10];
gol :char;
stat,jmlanak:integer;
gaj,tist,tank,jmltgaj,tlgaj:real;
begin
clrscr;
writeln(‘===============================================’);
writeln(‘TUGAS PERHITUNGAN GAJI DAN TUNJANGAN ANAK ISTRI’);
writeln(‘ Nama : Mahasiswa NIM : xxxxxxxxx ‘);
writeln(‘===============================================’);
writeln;
writeln(‘ Masukkan data sesuai pada ketentuan berikut ‘);
writeln(‘+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+’);
writeln;
writeln(‘Golongan Gaji : Status :’);
writeln(‘a. Rp 1,000,000.00 1. Kawin’);
writeln(‘b. Rp 1,500,000.00 2. Tidak Kawin’);
writeln(‘c. Rp 2,000,000.00′);
writeln;
write(‘Nomor Induk Karyawan : ‘);readln(noin);
write(‘Nama Pegawai : ‘);readln(nama);
write(‘Jabatan Pegawai : ‘);readln(jab);
write(‘Golongan Gaji : ‘);readln(gol);
case gol of
‘a’ : begin
gaj :=1000000;
write(‘Status Perkawinan : ‘);readln(stat);
case stat of
1 : begin
tist := (10/100)*gaj;
write(‘Jumlah anak : ‘);readln(jmlanak);
if jmlanak =1 then
tank := (10/100)*gaj
else
if jmlanak =2 then
tank := (15/100)*gaj
else
tank := (20/100)*gaj
end;
2 : begin
tist := 0;
tank := 0;
end;
end;
end;
‘b’ : begin
gaj :=1500000;
write(‘Status Perkawinan : ‘);readln(stat);
case stat of
1 : begin
tist := (15/100)*gaj;
write(‘Jumlah anak : ‘);readln(jmlanak);
if jmlanak =1 then
tank :=(10/100)*gaj
else
if jmlanak =2 then
tank :=(15/100)*gaj
else
tank :=(20/100)*gaj
end;
2 : begin
tist := 0;
tank := 0;
end;
end;
end;
‘c’ : begin
gaj :=2000000;
write(‘Status Perkawinan : ‘);readln(stat);
case stat of
1 : begin
tist := (20/100)*gaj;
write(‘Jumlah anak : ‘);readln(jmlanak);
if jmlanak =1 then
tank :=(10/100)*gaj
else
if jmlanak =2 then
tank :=(15/100)*gaj
else
tank :=(20/100)*gaj
end;
2 : begin
tist :=0;
tank :=0;
end;
end;
end;
end;
tlgaj := gaj+tank+tist;
writeln;
writeln(‘=================oO SLIP GAJI Oo=================’);
writeln;
writeln (‘Nama : ‘,nama);
writeln (‘No Karyawan : ‘,noin);
writeln (‘Jabatan : ‘,jab);
writeln (‘+===============================================+’);
writeln (‘| Rincian Gaji | Jumlah |’);
writeln (‘+===============================================+’);
writeln (‘| Gaji Pokok : | Rp ‘,gaj:8:0,’ |’);
writeln (‘| Tunjangan Anak : | Rp ‘,tank:8:0,’ |’);
writeln (‘| Tunjangan Istri : | Rp ‘,tist:8:0,’ |’);
writeln (‘| | |’);
writeln (‘+———————————————–+’);
writeln (‘| Total Gaji Bersih : | Rp ‘,tlgaj:8:0,’ |’);
writeln (‘+———————————————–+’);
readln;
end.