Power Point aplikasi array dalam matematika

24
Listing Program Delphy Disusun Oleh : Febyanti Andini 09511005

Transcript of Power Point aplikasi array dalam matematika

Page 1: Power Point aplikasi array dalam matematika

Listing Program Delphy

Disusun Oleh :Febyanti Andini

09511005

Page 2: Power Point aplikasi array dalam matematika

1. Form Cover• Tampilan Sebelum di Run • Tampilan sesudah di Run

Page 3: Power Point aplikasi array dalam matematika

• Listing Program Cover

var Form1: TForm1; implementationuses U_Loading, U_Main_menu, U_Mat1,

U_Mat2;{$R *.dfm} procedure TForm1.BitBtn1Click(Sender: TObject);beginform2.visible:=true;Form2.Timer1.Enabled := true; end;

procedurTForm1.Timer1Timer(Sender: TObject); beginLabel10.Left := label10.Left - 5;

if label10.Left <= -100 then

label10.Left := 550; if label10.Font.Color=clyellow thenlabel10.Font.Color:=clwhiteelselabel10.Font.Color:=clyellow;end;procedure TForm1.Timer2Timer(Sender: TObject);beginif label5.Font.Color=clmaroon thenlabel5.Font.Color:=clwhiteelselabel5.Font.Color:=clmaroon;end; end.

Page 4: Power Point aplikasi array dalam matematika

2. Form Loading• Tampilan sebelum di Run

• Tampilan Sesudah di Run

Page 5: Power Point aplikasi array dalam matematika

• Listing Program Loading

var Form2: TForm2; b:integer;implementation uses U_cover,U_Main_menu,U_Mat1,U_Mat2;{$R *.dfm}procedure TForm2.Timer1Timer(Sender: TObject);beginb:=b+1;if b=1 then label2.Caption:='W';if b=2 then label2.caption:=label2.Caption+'e';if b=3 then label2.caption:=label2.Caption+'L';if b=4 then label2.caption:=label2.Caption+'c';

if b=5 then label2.caption:=label2.Caption+'O';

if b=6 then label2.caption:=label2.Caption+'m';if b=7 then label2.caption:=label2.Caption+'e ';if b=8 then label2.caption:=label2.Caption+'T';if b=9 then label2.caption:=label2.Caption+'o ';if b=10 then label2.caption:=label2.Caption+'M';if b=11 then label2.caption:=label2.Caption+'y ';if b=12 then label2.caption:=label2.Caption+'P';if b=13 then label2.caption:=label2.Caption+'r';if b=14 then label2.caption:=label2.Caption+'O';if b=15 then label2.caption:=label2.Caption+'g';if b=16 then label2.caption:=label2.Caption+'R';if b=17 then label2.caption:=label2.Caption+'a';if b=18 then label2.caption:=label2.Caption+'M';

Page 6: Power Point aplikasi array dalam matematika

if b=20 thenbeginlabel2.Caption:='';b:=0; Form1.visible:=false;timer1.Enabled := false;Form2.Close;Form3.visible:=true;end;end;

procedure

TForm2.Timer2Timer(Sender: TObject);

beginif label1.Font.Color=clwhite thenlabel1.Font.Color:=clmaroonelselabel1.Font.Color:=clwhite; end;end.

Page 7: Power Point aplikasi array dalam matematika

3. Form Main Menu• Tampilan sebelum di Run • Tampilan Sesudah di Run

Page 8: Power Point aplikasi array dalam matematika

• Listing Program Main Menuvar Form3: TForm3; implementation uses U_cover, U_loading, U_mat1, U_mat2, U_selesai, U_profil;{$R *.dfm} procedure TForm3.GradiennyaDiketahui1Click(Sender: TObject);beginform5.Show;end; procedure TForm3.GradiennyaTidakDiketahui1Click(Send

er: TObject);beginform4.Show;end; procedure TForm3.Keluar1Click(Sender: TObject);beginform6.show;end; procedure TForm3.MyPropiL1Click(Sender: TObject);beginform7.Show;end;

Page 9: Power Point aplikasi array dalam matematika

procedure TForm3.Timer1Timer(Sender: TObject);

beginlabel1.Left := label1.Left - 5; if label1.Left <= -100 then label1.Left := 550; if label1.Font.Color=clyellow thenlabel1.Font.Color:=clwhiteelselabel1.Font.Color:=clyellow;end; procedure TForm3.Timer2Timer(Sender:

TObject);beginlabel2.Caption := formatdatetime('dddd',

(now));label3.Caption := formatdatetime('d mmmm

yyyy',(now));label4.Caption := formatdatetime('hh : mm :

ss',(now));end; procedure TForm3.Timer3Timer(Sender:

TObject);beginimage1.top := image1.top - 5; if image1.top <= -100 then image1.top := 550;end; End.

Page 10: Power Point aplikasi array dalam matematika

4. Form Profil• Tampilan sebelum di Run • Tampilan sesudah di Run

Page 11: Power Point aplikasi array dalam matematika

• Listing Program Profilvar Form7: TForm7; s:string; a,p,i:integer; nama:array[1..20] of string; kelas:array[1..20] of string; jurusan:array[1..20] of string; Fakultas:array[1..20] of string; nim:array[1..20] of string;implementation{$R *.dfm}procedure

TForm7.BitBtn1Click(Sender: TObject);

beginrandomize;a:=random (1000);edit1.Text:=inttostr(a);end;

procedure TForm7.BitBtn2Click(Sender: TObject);

beginif edit1.Text=edit2.Text thenbeginTimer2.Enabled:=true;Timer4.Enabled:=true; endelse beginmessagedlg('password anda

salah'+chr(10)+chr(13)+'coba anda ulangi',mtinformation,[mbOK],0);

edit1.SetFocus;

end;end;procedure

TForm7.BitBtn3Click(Sender: TObject);

beginedit1.Clear;edit2.Clear;listbox1.items.clear;s:=inputbox('Loop','Jumlah

Perulangan','');p:=strtoint(s);stringgrid1.cells[0,0]:='Nama';stringgrid1.cells[1,0]:='Nim';stringgrid1.cells[2,0]:='Kelas';stringgrid1.cells[3,0]:='Jurusan';stringgrid1.cells[4,0]:='Fakultas';

Page 12: Power Point aplikasi array dalam matematika

for i := 1 to p do beginnama[i]:=inputbox('ID','Nama',' ');nim[i]:=inputbox('ID','Nim',' ');kelas[i]:=inputbox('ID','Kelas',' ');jurusan[i]:=inputbox('ID','jurusan',' ');fakultas[i]:=inputbox('ID','Fakultas',' '); listbox1.Items.Add('>>>>>>>>>>>>> My

ProfiL <<<<<<<<<<<<<<<');listbox1.Items.Add(inttostr(i)+'.'+ 'Nama :

'+nama[i]);listbox1.Items.Add(' Nim : '+nim[i]);listbox1.Items.Add(' Kelas : '+kelas[i]);listbox1.Items.Add(' Jurusan : '+jurusan[i]);listbox1.Items.Add(' Fakultas : '+fakultas[i]); stringgrid1.cells[0,i]:=Nama[i];stringgrid1.cells[1,i]:=Nim[i];stringgrid1.cells[2,i]:=kelas[i];stringgrid1.cells[3,i]:=jurusan[i];stringgrid1.cells[4,i]:=fakultas[i]; end;timer3.Enabled:=true;end;

procedure TForm7.BitBtn4Click(Sender: TObject);

beginlistbox1.Clear;stringgrid1.Cells[0,0]:='';stringgrid1.Cells[1,0]:='';stringgrid1.Cells[2,0]:='';stringgrid1.Cells[3,0]:='';stringgrid1.Cells[4,0]:='';stringgrid1.Cells[0,1]:='';stringgrid1.Cells[0,2]:='';stringgrid1.Cells[0,3]:='';stringgrid1.Cells[0,4]:='';stringgrid1.Cells[1,1]:='';stringgrid1.Cells[1,2]:='';stringgrid1.Cells[1,3]:='';stringgrid1.Cells[1,4]:='';stringgrid1.Cells[2,1]:='';stringgrid1.Cells[2,2]:='';stringgrid1.Cells[2,3]:='';stringgrid1.Cells[2,4]:='';stringgrid1.Cells[3,1]:='';

stringgrid1.Cells[3,2]:='';stringgrid1.Cells[3,3]:='';stringgrid1.Cells[3,4]:='';stringgrid1.Cells[4,1]:='';stringgrid1.Cells[4,2]:='';stringgrid1.Cells[4,3]:='';stringgrid1.Cells[4,4]:='';end;

Page 13: Power Point aplikasi array dalam matematika

procedure TForm7.BitBtn5Click(Sender: TObject);

beginstringgrid1.Cells[0,0]:='';stringgrid1.Cells[1,0]:='';stringgrid1.Cells[2,0]:='';stringgrid1.Cells[3,0]:='';stringgrid1.Cells[4,0]:='';stringgrid1.Cells[0,1]:='';stringgrid1.Cells[0,2]:='';stringgrid1.Cells[0,3]:='';stringgrid1.Cells[0,4]:='';stringgrid1.Cells[1,1]:='';stringgrid1.Cells[1,2]:='';stringgrid1.Cells[1,3]:='';stringgrid1.Cells[1,4]:='';stringgrid1.Cells[2,1]:='';stringgrid1.Cells[2,2]:='';stringgrid1.Cells[2,3]:='';stringgrid1.Cells[2,4]:='';stringgrid1.Cells[3,1]:='';stringgrid1.Cells[3,2]:='';stringgrid1.Cells[3,3]:='';stringgrid1.Cells[3,4]:='';stringgrid1.Cells[4,1]:='';

stringgrid1.Cells[4,2]:='';stringgrid1.Cells[4,3]:='';stringgrid1.Cells[4,4]:='';panel1.Top:=550;groupbox1.Left:=730;groupbox2.Left:=730;timer2.enabled:=false;timer3.enabled:=false;timer4.enabled:=false;close;end; procedure

TForm7.Timer1Timer(Sender: TObject);

beginlabel2.Left := label2.Left - 5; if label2.Left <= -100 then label2.Left := 550; if label2.Font.Color=clblue thenlabel2.Font.Color:=clgreenelselabel2.Font.Color:=clblue;end;

procedure TForm7.Timer2Timer(Sender: TObject);beginif panel1.Top <> 176 thenbegin;panel1.Top := panel1.Top - 1;end;end; procedure TForm7.Timer3Timer(Sender: TObject);beginif groupbox1.left <> 362 thenbegin;groupbox1.left := groupbox1.left - 1;end; end; procedure TForm7.Timer4Timer(Sender: TObject);beginif groupbox2.left<> 21 thenbegin;groupbox2.left := groupbox2.left - 1;end;end; procedure TForm7.Timer5Timer(Sender: TObject);beginlabel3.Caption := formatdatetime('hh : mm : ss',

(now));end;end.

Page 14: Power Point aplikasi array dalam matematika

5. Form Matematika Part 1

• Tampilan sebelum di Run • Tampilan sesudah di Run

Page 15: Power Point aplikasi array dalam matematika

• Listing Program Matematika Part 1var Form4: TForm4; a,i:integer; Y:real; x1:array[0..9999]of

integer; y1:array[0..9999]of

integer; x2:array[0..9999]of

integer; y2:array[0..9999]of

integer; p:array[0..9999]of real; q:array[0..9999]of real; r:array[0..9999]of real; s:array[0..9999]of real; t:array[0..9999]of real; u:array[0..9999]of real; v:array[0..9999]of real; m:array[1..9999]of integer;

implementation{$R *.dfm}procedure

TForm4.BitBtn1Click(Sender: TObject);

beginedit1.clear;edit2.clear;edit3.clear;edit4.clear;end;

procedure TForm4.BitBtn2Click(Sender: TObject);

beginif a<=9999 thenbegin x1[a]:=strtoint(edit1.Text); edit1.SetFocus; y1[a]:=strtoint(edit2.Text); edit2.SetFocus; x2[a]:=strtoint(edit4.Text); edit3.SetFocus; y2[a]:=strtoint(edit3.Text); edit4.SetFocus;p[a]:=y2[a]-y1[a]; q[a]:=x2[a]-x1[a]; r[a]:=-y1[a]*q[a]; s[a]:=-x1[a]*p[a]; t[a]:=s[a]-r[a]; u[a]:=p[a]/q[a]; v[a]:=t[a]/q[a];

Page 16: Power Point aplikasi array dalam matematika

listbox1.Items.Add('================================================================================');

listbox1.Items.Add(' DATA KE '+inttostr(a)+' ');

listbox1.Items.Add('================================================================================');

listbox1.Items.Add('Yang melalui titik (x1,y1) = '+'('+inttostr(x1[a])+','+inttostr(y1[a])+')');

listbox1.Items.Add('Yang melalui titik (x2,y2) = '+'('+inttostr(x2[a])+','+inttostr(y2[a])+')');

listbox1.Items.Add('dan Gradiennya adalah = '+floattostr(u[a])); listbox1.Items.Add('Maka Persamaan garis Lurusnya adalah : '); listbox1.Items.Add(floattostr(q[a])+'Y = '+floattostr(p[a])+'x'+'+'+'('+floattostr(t[a])+')'); listbox1.Items.Add('Y = '+floattostr(p[a])+'/'+floattostr(q[a])+'x'+'+'+'('+floattostr(t[a])

+'/'+floattostr(q[a])+')'); listbox1.Items.Add('Y = '+floattostr(u[a])+'x'+'+'+'('+floattostr(v[a])+')'); listbox1.Items.Add(' ');End;

Page 17: Power Point aplikasi array dalam matematika

• if a<9999 then begin a:=a+1; edit5.text:=inttostr(a); timer4.enabled:=true; timer5.enabled:=true; end;end; procedure TForm4.BitBtn3Click(Sender: TObject);begina:=1;edit5.text:=floattostr(a);edit1.clear;edit2.clear;edit3.clear;edit4.clear;listbox1.Clear;panel3.Top:=600;panel1.Left:=710;

timer4.Enabled:=false;timer5.Enabled:=false;close;end;

procedure TForm4.FormCreate(Sender: TObject);begina:=1;edit5.text:=floattostr(a);end; procedure TForm4.Timer1Timer(Sender: TObject);beginlabel3.Left := label3.Left - 5; if label3.Left <= -100 then label3.Left := 550; if label3.Font.Color=clpurple thenlabel3.Font.Color:=clwhiteelselabel3.Font.Color:=clpurple;end;

Page 18: Power Point aplikasi array dalam matematika

procedure TForm4.Timer2Timer(Sender: TObject);

beginif label1.Font.Color=clwhite thenlabel1.Font.Color:=clfuchsiaelselabel1.Font.Color:=clwhite;end;

procedure TForm4.Timer3Timer(Sender: TObject);beginif label2.Font.Color=clfuchsia thenlabel2.Font.Color:=clwhiteelselabel2.Font.Color:=clfuchsia;end; procedure TForm4.Timer4Timer(Sender: TObject);beginif panel3.Top <> 383 thenbegin;

panel3.Top := panel3.Top - 1;end;end; procedure TForm4.Timer5Timer(Sender: TObject);beginif panel1.left <> 51 thenbegin;panel1.left := panel1.left - 1;End;end; procedure TForm4.Timer6Timer(Sender: TObject);beginlabel16.Caption := formatdatetime('hh : mm : ss',

(now));end;end.

Page 19: Power Point aplikasi array dalam matematika

6. Form Matematika Part 2• Tampilan Sebelum di Run • Tampilan Sesudah di Run

Page 20: Power Point aplikasi array dalam matematika

• Listing Program Matematika Part 2var Form5: TForm5; a,i:integer; Y:real; x1:array[0..9999]of integer; y1:array[0..9999]of integer; x2:array[0..9999]of integer; y2:array[0..9999]of integer; p:array[0..9999]of real; q:array[0..9999]of real; r:array[0..9999]of real; s:array[0..9999]of real; t:array[0..9999]of real; u:array[0..9999]of real; v:array[0..9999]of real; m:array[1..9999]of integer;

implementation {$R *.dfm} procedure TForm5.BitBtn1Click(Sender: TObject);beginif a<=9999 thenbegin m[a]:=strtoint(edit4.Text); edit2.SetFocus; x1[a]:=strtoint(edit2.Text); edit3.SetFocus; y1[a]:=strtoint(edit3.Text); edit4.setfocus; p[a]:=m[a]*x1[a]; q[a]:=-p[a]+y1[a]; Y:=m[a]+q[a];

Page 21: Power Point aplikasi array dalam matematika

listbox1.Items.Add('==========================================================); listbox1.Items.Add(' DATA KE '+inttostr(a));listbox1.Items.Add('==========================================================); listbox1.items.Add('Yang melalui titik (x,y) = '+'('+inttostr(x1[a])+','+inttostr(y1[a])+')'); listbox1.Items.Add('dan gradiennya (m) = '+inttostr(m[a])); listbox1.Items.Add('Maka persamaan garis Lurusnya: '); listbox1.Items.Add('Y = '+inttostr(m[a])+'x'+'+'+'('+floattostr(q[a])+')'); listbox1.Items.Add(' '); end; if a<9999 then begin a:=a+1; edit1.text:=inttostr(a); end else if a=9999 then messagedlg('STOP Data Bilangan Sudah 9999 buah',mtInformation,[mbYes],0); timer2.Enabled:=true;end;

Page 22: Power Point aplikasi array dalam matematika

procedure TForm5.BitBtn2Click(Sender: TObject);

begina:=1;edit1.text:=floattostr(a);edit2.Clear;edit3.clear;edit4.Clear;listbox1.Clear;panel1.top:=500;timer2.Enabled:=false;close;end; procedure

TForm5.BitBtn3Click(Sender: TObject);

beginedit2.clear;edit3.clear;edit4.clear;end;

procedure TForm5.FormCreate(Sender: TObject);

begina:=1;edit1.text:=floattostr(a);end; procedure

TForm5.Timer1Timer(Sender: TObject);

beginlabel10.Left := label10.Left - 5; if label10.Left <= -100 then label10.Left := 550; if label10.Font.Color=clblue thenlabel10.Font.Color:=clwhiteelselabel10.Font.Color:=clblue;end;

procedure TForm5.Timer2Timer(Sender: TObject);

beginif panel1.Top <> 8 thenbegin;panel1.Top := panel1.Top - 1;end;end; procedure

TForm5.Timer3Timer(Sender: TObject);

beginlabel8.Caption :=

formatdatetime('hh : mm : ss',(now));

end;end.

Page 23: Power Point aplikasi array dalam matematika

7. Form Selesai• Tampilan sebelum di Run

• Tampilan sesudah di Run

Page 24: Power Point aplikasi array dalam matematika

• Listing Program Selesaivar Form6: TForm6; implementation {$R *.dfm} procedure TForm6.BitBtn1Click(Sender: TObject);beginapplication.terminate;end; procedure TForm6.Timer1Timer(Sender: TObject);beginlabel1.Left := label10.Left - 5; if label1.Left <= -100 then label1.Left := 550;

if label1.Font.Color=clyellow thenlabel1.Font.Color:=clwhiteelselabel1.Font.Color:=clyellow;end;

procedure TForm6.Timer2Timer(Sender: TObject);beginlabel2.Caption := formatdatetime('dddd',(now));label3.Caption := formatdatetime('d mmmm yyyy',

(now));label4.Caption := formatdatetime('hh : mm : ss',

(now));end; end.