Senin, 04 Juli 2011

Jawaban Quis soal No.3

uses crt;
var
   kd     : byte;
   sts    : string;
   nm,nik : string;
   gaji   : longint;
   tot    : real;
   tj,tjk : real;
   lg     : char;
begin
     clrscr;
     repeat
     gotoxy(3,3); write('Kode    :'); readln(kd);
     gotoxy(3,4); write('Nama    :'); readln(nm);
     gotoxy(3,5); write('NIK     :'); readln(nik);
     gotoxy(3,6); write('Status  :'); readln(sts);
     gotoxy(3,7); write('______________________');
     gotoxy(3,8); write('Input lagi [Y/T] :'); readln(lg);
     until upcase(lg)='T';
     if kd =1 then
     begin
          gaji :=2500000;
          tj   :=0.35;
     end else if kd =2 then
     begin
          gaji :=2000000;
          tj   :=0.10;
     end else if kd =3 then
     begin
          gaji :=1500000;
          tj   :=0.05;
     end;
          if sts ='menikah' then tjk :=0.15;

          tot :=gaji+(tj*gaji)+(gaji*tjk);
     gotoxy(5,10); writeln('Kode jabatan      :',kd);
     gotoxy(5,12); writeln('Nama              :',nm);
     gotoxy(5,13); writeln('NIK               :',nik);
     gotoxy(5,14); writeln('Status            :',sts);
     gotoxy(5,15); writeln('Gaji              :Rp.',gaji);
     gotoxy(5,16); writeln('Tunjangan         :',tj:2:2);
     gotoxy(5,17); writeln('tunjangan keluarga:',tjk:2:2);
     gotoxy(5,18); writeln('Total gaji        :Rp.',tot:4:0);
     readln;

end.
 
 
 
 
 
 
 

Tidak ada komentar:

Posting Komentar