Sabtu, 16 Juli 2011

M.P.program

uses crt;
type Dosen  =  record
       kode          : string [3];
       nama          : string [40];
       keahlian      : string [20];
      pendidikan  : string [20];
      end;
var
   fdsn         : file of dosen;
   rdsn         : dosen;
   i            : byte;
   xkd          : string [31];
   lg           : char;
   ada          : boolean;
procedure opendosen;
begin
    clrscr;
    assign (fdsn,'c:\dosen.dat');
    {$I-} reset (fdsn);
    {$I+} if IOresult <> 0 then rewrite (fdsn);
end;
begin
    opendosen;
    repeat
         a:=1;
         ada := false;
         gotoxy (3,5); write ('kode:'); readln (xkd);
         seek (fdsn,0);
         while not eof (fdsn) do
         begin
             seek (fdsn, a-1); read (fdsn,rdsn);
             if rdsn.kode = xkd then
             begin
                 gotoxy (10,3); write ('nama: ', rdsn.nama);
             gotoxy (10,4); write ('keahlian :',rdsn.keahlian);
                 gotoxy (10,5); write ('pendidikan : ', rdsn.pendidikan);
                 ada := true;
             end;
                 inc (i);
             end;
             rdsn.kode := xkd  ;
             if not ada then
             begin
                 gotoxy (20,2); write ('nama: '); readln (rdsn.nama);
                 gotoxy (20,3); write ('keahlian: '); readln (rdsn.keahlian);
                 gotoxy (20,4); write ('pendidikan :'); readln (rdsn.pendidikan);
                 seek (fdsn, filesize (fdsn));
                 write (fdsn, rdsn);
             end;
             gotoxy (30,3); write ('input lagi [Y/T]:'); readln (lg);
    until upcase (lg) = 'T';
    close (fdsn);
end.

Selasa, 05 Juli 2011


uses crt;
type  pegawai=record
      nip : string[8];
      nama: string[20];
      gol : string[4];
      jumlah: byte;
      end;
var
  ketemu : boolean;
  xnip   : string[8];
  fpegawai: file of  pegawai;
  rpegawai: pegawai;
  i      : byte;
  lg     : char;
procedure openpegawai;
begin
   assign(fpegawai,'c:\pegawai.dat');
   {$I-} reset (fpegawai);
   {$I+} if ioresult<>0 then rewrite(fpegawai);
end;

begin
  openpegawai;
  repeat;
     clrscr;
     gotoxy(10,5);write('nip   :');readln(rpegawai.nip);
     xnip := rpegawai.nip;
     i := 1;
     seek(fpegawai,0);ketemu := false;
     while not eof(fpegawai) do
     begin
       seek (fpegawai,i-1);read(fpegawai,rpegawai);
       if (rpegawai.nip=xnip) then
       begin
         ketemu := true;
         gotoxy(10,6);write ('Nama :',rpegawai.nama);
         gotoxy(10,7);write ('gol :',rpegawai.gol);
         gotoxy(10,8);write ('jumlah anak :',rpegawai.jumlah);
         gotoxy(10,9);write ('data sudah ada!');readln;
       end;
       inc(i);
     end;
     if not ketemu then
     begin
         RPEGAWAI.NIP := XNIP ;
         gotoxy(10,6);write ('Nama :');readln(rpegawai.nama);
         gotoxy(10,7);write ('gol :');readln(rpegawai.gol);
         gotoxy(10,8);write ('jumlah anak :');readln(rpegawai.jumlah);
         seek(fpegawai,filesize(fpegawai));
         write(fpegawai,rpegawai);
     end;
     gotoxy(10,9);write('input lagi[Y/T]:');readln(lg);
  until upcase(lg) ='T';
  close(fpegawai);
end.







Contoh Surat Persi Full Block

PT. GOLD BALL
Semarang Street No. 47
YOGYAKARTA
Ref : II/SA/65U
30  Juny, 2011

The Esteemed ;
PT. CORN
Jaya Street No. 12
SURABAYA

Dear sirs,
We are an Gold Ball company who move in network computer and need a few peripheral networking  like Switches, Router, Bridge, etc.
We have seen on your website in www.cisco.com and our company very interested for your promotion price.
Please let us have details Spesification of that peripheral and new pricelist.
If  you not heaviness, please give us catalogue including sample product with warranty of that product and how the procedure terms of payment.

We appreciate your prompt reply.

Yours faithfully,



Aminullah .Srg
Manager



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.

uses crt;
type
  Dosen = record
    kode  : string[3];
    nama  : string;
    pen   : string;
    kea     : string;
end;
  Mahasiswa= Record
    NPM        : string[7];
    NAMA       : string[15];
    jen,jur    : string[15];
    thn        : string;
end;
var
   rDos       : array[1..25] of Dosen;
   rMah       : array[1..15] of Mahasiswa;
   i,j        : byte;
   Pil, lg    : char;
procedure InputDosen;
   Procedure FormDosen;
   begin
    clrscr;
    gotoxy(13,3); write('INPUT DATA DOSEN');
    gotoxy(5,4); write('_____________________________');
    gotoxy(5,5); write('Kode Dosen     :');
    gotoxy(5,6); write('NAMA           :');
    gotoxy(5,7); write('Pendidikan     :');
    gotoxy(5,8); write('Keahlian       :');
    gotoxy(5,9); write('_____________________________');
    gotoxy(5,10); write('isikan data lagi [Y/T]:');
end;
begin
    repeat
        Formdosen;
        with Rdos[i] do
        begin
    gotoxy(22,5); readln(kode);
    gotoxy(22,6); readln(Nama);
    gotoxy(22,7); readln(pen);
    gotoxy(22,8); readln(kea);
    gotoxy(29,10); readln(lg);
    inc(i);
    end;
    until upcase(lg)='T';
end;
procedure InputMahasiswa;
   Procedure FormMahasiswa;
   begin
    clrscr;
    gotoxy(13,3); write('INPUT DATA MAHASISWA');
    gotoxy(5,4); write('_____________________________');
    gotoxy(5,5); write('NPM            :');
    gotoxy(5,6); write('NAMA           :');
    gotoxy(5,7); write('Jenjang        :');
    gotoxy(5,8); write('Jurusan        :');
    gotoxy(5,9); write('Tahun          :');
    gotoxy(5,10); write('_____________________________');
    gotoxy(5,11); write('isikan data lagi [Y/T]:');
end;
begin
    repeat
        FormMahasiswa;
        with Rmah[i] do
        begin
    gotoxy(22,5); readln(NPM);
    gotoxy(22,6); readln(NAMA);
    gotoxy(22,7); readln(jen);
    gotoxy(22,8); readln(jur);
    gotoxy(22,9); readln(thn);
    gotoxy(29,11); readln(lg);
    inc(i);
    end;
    until upcase(lg)='T';
end;
Procedure OutputDosen;
  Procedure TabelDosen;
  begin
   clrscr;
   gotoxy(10,4); write('                INPUT DATA DOSEN');
   gotoxy(3,5); write('___________________________________________________');
   gotoxy(3,6); write('  NO  Kode  Nama           Pendidikan   Keahlian');
   gotoxy(3,7); write('---------------------------------------------------');
end;
begin
   TabelDosen;
   for j:=1 to I-1 do
   begin
        with RDos[j] do
        begin
        gotoxy(5,7+j); write(j:1,'  ',kode:4);
        gotoxy(15,7+j); write(nama);
        gotoxy(30,7+j); write(pen);
        gotoxy(43,7+j); write(kea);
        end;
     end;
     gotoxy(3,9+j); write('___________________________________________________');
     repeat until keypressed;
end;
Procedure OutputMahasiswa;
  Procedure TabelMahasiswa;
  begin
   clrscr;
   gotoxy(10,4); write('                INPUT DATA MAHASISWA');
   gotoxy(3,5); write('____________________________________________________________________________');
   gotoxy(3,6); write('  NO  NPM       NAMA        Jenjang     Jurusan     Tahun');
   gotoxy(3,7); write('----------------------------------------------------------------------------');
end;
begin
   TabelMahasiswa;
   for j:=1 to I-1 do
   begin
        with RMah[j] do
        begin
        gotoxy(5,7+j); write(j:0,'  ',NPM:8,'  ',NAMA);
        gotoxy(33,7+j); write(jen);
        gotoxy(44,7+j); write(jur);
        gotoxy(56,7+j); write(thn);
        end;
     end;
     gotoxy(3,7+j); write('_____________________________________________________________________________');
     repeat until keypressed;
end;
procedure menu;
begin
     clrscr;
     gotoxy(20,2); write('MENU PEGAWAI');
     gotoxy(10,3); write('_________________________________________');
     gotoxy(10,4); write('[1]. Input Data Dosen');
     gotoxy(10,5); write('[2]. Input Data Mahasiswa');
     gotoxy(10,6); write('[3]. Output data Dosen');
     gotoxy(10,7); write('[4]. Output data Mahasiswa');
     gotoxy(10,8); write('[5]. Keluar Program');
     gotoxy(10,9); write('__________________________________________');
     gotoxy(10,10); write('Pilihan    :');
end;
begin{Program Utama}
i:=1; Pil:='1';
while Pil<>'5' do
begin
     menu;
     pil:=readkey;
     case Pil of
     '1': InputDosen;
     '2': InputMahasiswa;
     '3': OutputDosen;
     '4': OutputMahasiswa;
end;
end;
end.