Rabu, 02 Januari 2013

PROGRAM MEMBACA IDENTITAS PEGAWAI BERDASARKAN NIP

uses crt;

var
s,sex,tgl_lahir : string;
a,b,c,d,e,f,g,o : string;

function bulanx(var str:string):string;
   var output:string;
   begin
     if str='01' then output := 'Januari'
     else if str='02' then output := 'Februari'
     else if str='03' then output :='Maret'
     else if str='04' then output:= 'April'
     else if str='05' then output:= 'Mei'
     else if str='06' then output:= 'Juni'
     else if str='07' then output:= 'Juli'
     else if str='08' then output:= 'Agustus'
     else if str='09' then output:= 'September'
     else if str='10' then output:= 'Oktober'
     else if str='11' then output:= 'November'
     else if str='12' then output:= 'Desember'
     else output:= 'Tidak Dikenal';

     bulanx:= output;
   end;




begin
   clrscr;
   write ('masukan nama : '); readln (s);
   write ('masukan NIP : '); readln (o);
   a := o[1]+o[2]+o[3]+o[4];
   b := o[5]+o[6];
   b := bulanx(b);

   c := o[7]+o[8];
   d := o[9]+o[10]+o[11]+o[12];
   e := o[13]+o[14];
   e:= bulanx(e);

   f := o[15]+o[16];
   g := o[17]+o[18]+o[19];

    tgl_lahir := c + ' ' + b + ' ' + a;

     if f='01' then sex:= 'Laki Laki'
     else if f='02' then sex:= 'Perempuan'
     else sex:= 'kelamin tidak diketahui';


   writeln('Nama              : ',s);
   writeln('Tanggal Lahir     : ',tgl_lahir);
   writeln('Tahun Masuk       : ',d);
   writeln('Bulan Masuk       : ',e);
   writeln('Sex               : ',sex);
   writeln('No urut           : ',g);
   readln;
end.

Tidak ada komentar: