Selamat Datang Di Kelas Produktif Teknik Komputer Jaringan

27 September 2014

program fascal data karyawan

program inventory;
uses crt;
var
 nm:array [1..5] of string;
 gol:array [1..5] of integer;
 i,n:integer;
 tunj,total,gajipok:array [1..5] of longint;

Procedure Seleksi;
Begin
 Case gol[i] of
 1:Begin
   gajipok[i]:=1000000;
   tunj[i]:=250000;
   total[i]:=gajipok[i]+tunj[i];
   End;
 2:Begin
   gajipok[i]:=1500000;
   tunj[i]:=400000;
   total[i]:=gajipok[i]+tunj[i];
   End;
 3:Begin
   gajipok[i]:=2000000;
   tunj[i]:=500000;
   total[i]:=gajipok[i]+tunj[i];
   End;
 End;
End;

Procedure Tampil;
Begin
 Clrscr;
 textcolor(12);
 writeln('                    DATA KARYAWAN BULAN INI  ');
 writeln('=================================================================');
 writeln('No Nama          gOL     gAJI pokok    Tunjangan     total GAJI');
 writeln('=================================================================');
 For i:=1 To 5 Do
  Begin
    gotoxy(1,wherey);write(i);
    gotoxy(4,wherey);write(Nm[i]);
    gotoxy(18,wherey);write(gol[i]);
    gotoxy(26,wherey);write(gajipok[i]);
    gotoxy(40,wherey);write(tunj[i]);
    gotoxy(54,wherey);write(total[i]);
    writeln;
  End;
 writeln('=================================================================');
End;

Begin
Clrscr;
 writeln(' DATA KARYAWAN BULAN INI ');

 For i:=1 To 5 Do
 Begin
    write('Nama      : ');readln(nm[i]);
    write('Golongan  : ');readln(gol[i]);
    writeln;

  Seleksi;
 End;
  Tampil;
  readln;
End.