Senin, 02 Januari 2012

Program Pascal Multi Key

           Dalam program ini tidak di buat untuk menginput data,karena datanya sudah saya buat menggunakan notepad dengan nama biodata.dat & filenirm.dat.
Is dari biodata.dat sebagai berikut:
30110726
100
Andre Luckyanto
Depok
31002938
101
Aaaaa Bbbbbbbbb
Jakarta
73892340
200
Bbbbb Ccccccccc
Kelapa dua
23810229
203
Ccccc Ddddddddd
Kuningan
38291038
439
Ddddd Eeeeeeeee
Jakarta
89230239
241
Eeeee Fffffffff
Depok
83402340
231
Fffff Ggggggggg
Depok
23802432
213
Ggggg Hhhhhhhhh
Jakarta
12320342
098
Iiiii Jjjjjjjjj
kelapa dua
29834022
211
Jjjjj Kkkkkkkkk
Depok


Lalu isi dari filenirm.dat :
100
15 12 2010
16 12 2013
200
24 05 2007
25 05 2010
101
23 10 2005
24 10 2009
213
03 03 2003
04 03 2006
098
07 05 2008
08 05 2012
211
05 06 2011
06 06 2014
231
21 05 2011
21 05 2015
203
18 07 2009
19 07 2012
439
13 04 2008
14 04 2011
241
23 04 2009
24 04 2013

Listing program :
uses crt;
type
filebio = record
     npm:string[8];
     nirm:string[3];
     nama:string[15];
     alamat:string[10];
     end;
filenirm = record
     nirm2:string[3];
     masuk:string[10];
     akhir:string[10];
     end;
var
biodata :array[1..10] of filebio;
tglnirm :array[1..10] of filenirm;
isi:text;
a,x,y:integer;


Procedure tbio;
begin
a:=5;
assign(isi,'biodata.dat');
reset(isi);
writeln('Biodata');
writeln('************************************************************');
writeln('*    Npm     * Nirm  *         Nama        *     alamat    *');
writeln('************************************************************');
for x:=1 to 10 do
begin
readln(isi,biodata[x].npm);
readln(isi,biodata[x].nirm);
readln(isi,biodata[x].nama);
readln(isi,biodata[x].alamat);
write('*  ',biodata[x].npm,'  *  ',biodata[x].nirm,'  *   ',biodata[x].nama,'   *    ',biodata[x].alamat:5);
gotoxy(60,a);
writeln('*');
a:=a+1;
end;
close(isi);
writeln('************************************************************');
readln;
end;

procedure tnirm;
begin
assign(isi,'filenirm.dat');
reset(isi);
writeln('File Nirm');
writeln('*****************************************************');
writeln('* Nirm   *    Tanggal Masuk    *    Tanggal Akhir   *');
writeln('*****************************************************');
for x := 1 to 10 do
begin
readln(isi,tglnirm[x].nirm2);
readln(isi,tglnirm[x].masuk);
readln(isi,tglnirm[x].akhir);
writeln('*  ',tglnirm[x].nirm2,'   *     ',tglnirm[x].masuk,'      *     ',tglnirm[x].akhir,'     *');
end;
writeln('*****************************************************');
close(isi);
readln;
end;


procedure daftarsiswa;
begin
a:=5;
writeln('Daftar Siswa');
writeln('***********************************************************************');
writeln('* No *    Npm   * Nirm *       Nama       *  Tgl masuk  *  Tgl Akhir  *');
writeln('***********************************************************************');
for x := 1 to 10 do
begin
write('* ',x,'  * ',biodata[x].npm,' * ',biodata[x].nirm,'  * ',biodata[x].nama,'  *','             *','             *');
for y := 1 to 10 do
if biodata[x].nirm = tglnirm[y].nirm2 then
begin
gotoxy(46,a);
writeln(tglnirm[y].masuk);
gotoxy(60,a);
writeln(tglnirm[y].akhir);
a:=a+1;
end;
end;
writeln('***********************************************************************');
readln;
end;

begin
clrscr;tbio;
clrscr;tnirm;
clrscr;daftarsiswa;
end.          


Screenshot program :

klik untuk memperbesar
klik untuk memperbesar



klik untuk memperbesar




0 komentar:

Posting Komentar