26
Diajukan Untuk Memenuhi Salah Satu Tugas Mata Kuliah Program Komputer Dosen : Drs Deddy Sofyan M,Pd Jurusan Pendidikan Matematika Sekolah Tinggi Keguruan dan Ilmu Pendidikan STKIP-Garut 2010-2011 PROGRAM MATEMATIKA DAN IDENTITAS Di Susun Oleh : Wildan Ahmad Nawawi (09511026)

Power Point Tugas Akhir Delphi

Embed Size (px)

Citation preview

Page 1: Power Point Tugas Akhir Delphi

Diajukan Untuk Memenuhi Salah Satu Tugas Mata Kuliah Program KomputerDosen : Drs Deddy Sofyan M,Pd

Jurusan Pendidikan Matematika

Sekolah Tinggi Keguruan dan Ilmu Pendidikan

STKIP-Garut

2010-2011

PROGRAM MATEMATIKA DAN IDENTITAS

Di Susun Oleh :

Wildan Ahmad Nawawi (09511026)

Page 2: Power Point Tugas Akhir Delphi

Form PaswordListing Form Pasword varprocedure TForm_Password.BitBtn1Click(Sender: TObject);beginif ((edit2.Text<>'') and (edit2.Text=edit3.Text)) and (edit1.Text<>'') thenbeginForm_Loading.ProgressBar1.Position := 0;Form_Loading.Timer1.Enabled := true;Form_Loading.Visible:=true;assword: TForm_Password;implementation uses U_loading,U_Main_menu,U_Biodata,U_Matematika;{$R *.dfm}

Page 3: Power Point Tugas Akhir Delphi

edit1.setfocus;edit2.setfocus;edit3.setfocus;endelse messagedlg('Password Anda Salah'+chr(10)+chr(13)+'Coba Anda Ulangi Lagi',mtinformation,[mbOK],0);end;procedure TForm_Password.Timer1Timer(Sender: TObject);beginlabel4.Left := label4.Left - 5; if label4.Left <= -100 then label4.Left := 550; if label4.Font.Color=clfuchsia thenlabel4.Font.Color:=clwhiteelselabel4.Font.Color:=clfuchsia;end;end.

Page 4: Power Point Tugas Akhir Delphi

Form Loading

Page 5: Power Point Tugas Akhir Delphi

Listing Form LoadingvarForm_Loading: TForm_Loading;implementation uses U_Password,U_Main_menu,U_Biodata,U_Matematika;{$R *.dfm}procedure TForm_Loading.Timer1Timer(Sender: TObject);beginif progressbar1.Position <> 100 thenprogressbar1.Position := progressbar1.Position +1elsebeginForm_Password.visible:=false;timer1.Enabled := false;Form_Loading.Close;Form_Main_menu.visible:=true;Form_Loading.Visible:=false;end;end;

procedure TForm_Loading.Timer2Timer(Sender: TObject);beginif progressbar1.Position <> 100 thenprogressbar1.Position := progressbar1.Position +1elsebegintimer2.Enabled := false;Form_Loading.Close;Form_Biodata.visible:=true;Form_Loading.Visible:=false;end;end;procedure TForm_Loading.Timer3Timer(Sender: TObject);beginif progressbar1.Position <> 100 thenprogressbar1.Position := progressbar1.Position +1elsebegintimer3.Enabled := false;Form_Loading.Close;Form_Matematika.visible:=true;Form_Loading.Visible:=false;

Page 6: Power Point Tugas Akhir Delphi

end;end;procedure TForm_Loading.Timer4Timer(Sender: TObject);begin if label1.Font.Color=clfuchsia thenlabel1.Font.Color:=clwhiteelselabel1.Font.Color:=clfuchsia;end;end.

Page 7: Power Point Tugas Akhir Delphi

Form Main Menu

Sebelum di Running Setelah di Running

Page 8: Power Point Tugas Akhir Delphi

Listing Program Form Menuvar Form_Main_menu: TForm_Main_menu;implementationuses U_Password,U_loading,U_Biodata,U_Matematika;{$R *.dfm}procedure TForm_Main_menu.BarisanD1Click(Sender: TObject);begin//Form_Matematika.show;Form_Loading.ProgressBar1.Position := 0;Form_Loading.Timer3.Enabled := true;Form_Loading.Visible:=true;end;procedure TForm_Main_menu.Biodata1Click(Sender: TObject);begin//Form_Biodata.show;Form_Loading.ProgressBar1.Position := 0;Form_Loading.Timer2.Enabled := true;Form_Loading.Visible:=true;end;

Page 9: Power Point Tugas Akhir Delphi

var Form_Main_menu: TForm_Main_menu;implementation uses U_Password,U_loading,U_Biodata,U_Matematika;{$R *.dfm}procedure TForm_Main_menu.BarisanD1Click(Sender: TObject);begin//Form_Matematika.show;Form_Loading.ProgressBar1.Position := 0;Form_Loading.Timer3.Enabled := true;Form_Loading.Visible:=true;end;procedure TForm_Main_menu.Biodata1Click(Sender: TObject);begin//Form_Biodata.show;Form_Loading.ProgressBar1.Position := 0;Form_Loading.Timer2.Enabled := true;Form_Loading.Visible:=true;end;procedure TForm_Main_menu.Keluar1Click(Sender: TObject);beginapplication.terminate;end;procedure TForm_Main_menu.Timer1Timer(Sender: TObject);

beginlabel3.Left := label3.Left - 5; if label3.Left <= -100 thenlabel3.Left := 550;

if label3.Font.Color=clfuchsia thenlabel3.Font.Color:=clwhiteelselabel3.Font.Color:=clfuchsia;end;procedure TForm_Main_menu.Timer2Timer(Sender: TObject);begin if image2.visible=true thenimage2.visible:=falseelseimage2.visible:=true;end;end.

Page 10: Power Point Tugas Akhir Delphi

Form Biodata Sebelum di Running Setelah di Running

Page 11: Power Point Tugas Akhir Delphi

Listing Form Biodata var Form_Biodata: TForm_Biodata; s:string; p,i:integer; nama:array[1..20] of string; nim:array[1..20] of string; kelahiran:array[1..20] of string; alamat:array[1..20] of string; telpon:array[1..20] of string; implementation uses U_Password,U_Loading,U_Main_menu,U_Matematika; {$R *.dfm} procedure TForm_Biodata.Button1Click(Sender: TObject);

Page 12: Power Point Tugas Akhir Delphi

beginlistbox1.items.clear;s:=inputbox('Loop','Jumlah Perulangan','');p:=strtoint(s);stringgrid1.cells[0,0]:='Nama';stringgrid1.cells[1,0]:='Nim';stringgrid1.cells[2,0]:='Kelahiran';stringgrid1.cells[3,0]:='Alamat';stringgrid1.cells[4,0]:='Telpon';listbox1.Items.Add('No '+'Nama '+' Nim '+' Kelahiran '+' Alamat '+' No.Telephon ');listbox1.Items.Add('-------------------------------------------------------------------------------');for i := 1 to p do beginnama[i]:=inputbox('ID','Nama',' ');nim[i]:=inputbox('ID','Nim',' ');kelahiran[i]:=inputbox('ID','Kelahiran',' ');alamat[i]:=inputbox('ID','Alamat',' ');telpon[i]:=inputbox('ID','Telpon',' ');

listbox1.Items.Add(inttostr(i)+'. '+nama[i]+' '+nim[i]+' '+kelahiran[i]+' '+alamat[i]+' '+telpon[i]); stringgrid1.cells[0,i]:=Nama[i];stringgrid1.cells[1,i]:=Nim[i];stringgrid1.cells[2,i]:=Kelahiran[i];stringgrid1.cells[3,i]:=Alamat[i];stringgrid1.cells[4,i]:=Telpon[i]; end;end; procedure TForm_Biodata.Button2Click(Sender: TObject);

Page 13: Power Point Tugas Akhir Delphi

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]:='';close;end;

procedure TForm_Biodata.Timer1Timer(Sender: TObject);beginif label1.Font.Color=clyellow thenlabel1.Font.Color:=cllimeelselabel1.Font.Color:=clyellow;if label4.Font.Color=clyellow thenlabel4.Font.Color:=cllimeelselabel4.Font.Color:=clyellow;if label5.Font.Color=clyellow thenlabel5.Font.Color:=cllimeelselabel5.Font.Color:=clyellow;

if label6.Font.Color=clyellow thenlabel6.Font.Color:=cllimeelselabel6.Font.Color:=clyellow;if label7.Font.Color=clyellow thenlabel7.Font.Color:=cllimeelselabel7.Font.Color:=clyellow;if label8.Font.Color=clyellow thenlabel8.Font.Color:=cllimeelselabel8.Font.Color:=clyellow;if label9.Font.Color=clyellow thenlabel9.Font.Color:=cllimeelselabel9.Font.Color:=clyellow;if

label10.Font.Color=clyellow thenlabel10.Font.Color:=cllimeelselabel10.Font.Color:=clyellow;if label11.Font.Color=clyellow thenlabel11.Font.Color:=cllimeelselabel11.Font.Color:=clyellow;if label12.Font.Color=clyellow thenlabel12.Font.Color:=cllimeelselabel12.Font.Color:=clyellow;

Page 14: Power Point Tugas Akhir Delphi

if label13.Font.Color=clyellow thenlabel13.Font.Color:=cllimeelselabel13.Font.Color:=clyellow;if label14.Font.Color=clyellow thenlabel14.Font.Color:=cllimeelselabel14.Font.Color:=clyellow;if label15.Font.Color=clyellow thenlabel15.Font.Color:=cllimeelselabel15.Font.Color:=clyellow;if label16.Font.Color=clyellow thenlabel16.Font.Color:=cllimeelselabel16.Font.Color:=clyellow;end;procedure TForm_Biodata.Timer2Timer(Sender: TObject);beginif label17.Font.Color=cllime thenlabel17.Font.Color:=clyellowelselabel17.Font.Color:=cllime;if label18.Font.Color=cllime thenlabel18.Font.Color:=clyellowelselabel18.Font.Color:=cllime;

if label19.Font.Color=cllime thenlabel19.Font.Color:=clyellowelselabel19.Font.Color:=cllime;if label20.Font.Color=cllime thenlabel20.Font.Color:=clyellowelselabel20.Font.Color:=cllime;if label21.Font.Color=cllime thenlabel21.Font.Color:=clyellowelselabel21.Font.Color:=cllime;if label22.Font.Color=cllime thenlabel22.Font.Color:=clyellowelselabel22.Font.Color:=cllime;if label23.Font.Color=cllime thenlabel23.Font.Color:=clyellowelselabel23.Font.Color:=cllime; if label24.Font.Color=cllime thenlabel24.Font.Color:=clyellowelselabel24.Font.Color:=cllime; if label25.Font.Color=cllime thenlabel25.Font.Color:=clyellowelselabel25.Font.Color:=cllime; if label26.Font.Color=cllime thenlabel26.Font.Color:=clyellowelselabel26.Font.Color:=cllime;

Page 15: Power Point Tugas Akhir Delphi

if label27.Font.Color=cllime thenlabel27.Font.Color:=clyellowelselabel27.Font.Color:=cllime;if label28.Font.Color=cllime thenlabel28.Font.Color:=clyellowelselabel28.Font.Color:=cllime; if label29.Font.Color=cllime thenlabel29.Font.Color:=clyellowelselabel29.Font.Color:=cllime;End;procedure TForm_Biodata.Timer3Timer(Sender: TObject);beginlabel31.Left := label31.Left - 5;if label31.Left <= -100 then label31.Left := 550; if label31.Font.Color=cllime thenlabel31.Font.Color:=clwhiteelselabel31.Font.Color:=cllime;end;

{procedure TForm_Biodata.Timer3Timer(Sender: TObject);beginlabel30.Left := label30.Left + 5;if label30.Left <= +100 then label30.Left := 550; if label30.Font.Color=cllime thenlabel30.Font.Color:=clwhiteelselabel30.Font.Color:=cllime;timer6.Enabled:=true;end;}{procedure TForm_Biodata.Timer4Timer(Sender: TObject);beginlabel30.Left := label30.Left - 5; if label30.Left <= -100 then label30.Left := 743; if label30.Font.Color=cllime thenlabel30.Font.Color:=clwhiteelselabel30.Font.Color:=cllime;{timer6.Enabled:=false; timer4.enabled:=true;end;

{procedure TForm_Biodata.Timer5Timer(Sender: TObject);beginlabel31.Left := label31.Left + 5; if label31.Left <= +100 then label31.Left := 743; if label31.Font.Color=cllime thenlabel31.Font.Color:=clyellowelselabel31.Font.Color:=cllime;timer4.Enabled:=true;end;}procedure TForm_Biodata.Timer6Timer(Sender: TObject);begin{timer4.Enabled:=false;timer6.enabled:=true;}label31.Left := label31.Left - 5; if label31.Left <= -100 then label31.Left := 743;

Page 16: Power Point Tugas Akhir Delphi

Form Matematika sebelum diRunning

Page 17: Power Point Tugas Akhir Delphi

Form Matematika Setelah di Running

Page 18: Power Point Tugas Akhir Delphi

Listing Program var Form_Matematika: TForm_Matematika; 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 uses U_Password,U_Loading,U_Main_menu,U_Biodata;{$R *.dfm}

procedure TForm_Matematika.BitBtn1Click(Sender: TObject);beginif a<=9999 thenbegin m[a]:=strtoint(edit3.Text); edit2.SetFocus; x1[a]:=strtoint(edit1.Text); edit3.SetFocus; y1[a]:=strtoint(edit2.Text); edit4.setfocus; p[a]:=m[a]*x1[a]; q[a]:=-p[a]+y1[a]; Y:=m[a]+q[a];

Page 19: Power Point Tugas Akhir Delphi

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 adalah : '); listbox1.Items.Add('Y = '+inttostr(m[a])+'x'+'+'+'('+floattostr(q[a])+')'); listbox1.Items.Add(' '); end; if a<9999 then begin a:=a+1; edit4.text:=inttostr(a); end

Page 20: Power Point Tugas Akhir Delphi

else if a=9999 then messagedlg('STOP Data Bilangan Sudah 9999 buah',mtInformation,[mbYes],0);end;procedure TForm_Matematika.BitBtn3Click(Sender: TObject);beginedit1.clear;edit2.clear;edit3.clear;edit1.setfocus;end;procedure TForm_Matematika.BitBtn5Click(Sender: TObject);beginedit5.clear;edit6.clear;edit7.clear;edit8.clear;end;

procedure TForm_Matematika.BitBtn6Click(Sender: TObject);beginif a<=9999 thenbegin x1[a]:=strtoint(edit5.Text); edit5.SetFocus; y1[a]:=strtoint(edit6.Text); edit6.SetFocus; x2[a]:=strtoint(edit7.Text); edit7.SetFocus; y2[a]:=strtoint(edit8.Text); edit8.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 21: Power Point Tugas Akhir Delphi

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

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

; listbox2.Items.Add('Yang melalui titik (x1,y1) = '+'('+inttostr(x1[a])+','+inttostr(y1[a])+')'); listbox2.Items.Add('Yang melalui titik (x2,y2) = '+'('+inttostr(x2[a])+','+inttostr(y2[a])+')'); listbox2.Items.Add('dan Gradiennya adalah = '+floattostr(u[a])); listbox2.Items.Add('Maka Persamaan garis Lurusnya adalah : '); listbox2.Items.Add(floattostr(q[a])+'Y = '+floattostr(p[a])+'x'+'+'+'('+floattostr(t[a])+')');listbox2.Items.Add('Y ='+floattostr(p[a])+'/'+floattostr(q[a])+'x'+'+'+'('+floattostr(t[a])

+'/'+floattostr(q[a])+')'); listbox2.Items.Add('Y = '+floattostr(u[a])+'x'+'+'+'('+floattostr(v[a])+')'); listbox2.Items.Add(' '); end; if a<9999 then begin a:=a+1; edit9.text:=inttostr(a); end;end;

Page 22: Power Point Tugas Akhir Delphi

procedure TForm_Matematika.BitBtn7Click(Sender: TObject);beginclose;end;procedure TForm_Matematika.Button1Click(Sender: TObject);beginlabel38.Visible:=false;panel3.Visible:=false;groupbox1.visible:=true;a:=1;edit4.text:=floattostr(a);end;procedure TForm_Matematika.Button2Click(Sender: TObject);beginlabel38.Visible:=false;panel3.Visible:=false;groupbox2.visible:=true;a:=1;edit9.text:=floattostr(a);end;

ProcedureTForm_Matematika.Button3Click(Sender:

TObject);beginlabel38.Visible:=true;panel3.Visible:=true;groupbox2.Visible:=false;edit5.clear;edit6.clear;edit7.clear;edit8.clear;edit9.clear;listbox2.Clear;end;ProcedureTForm_Matematika.Button4Click(Sender:

TObject);beginlabel38.Visible:=true;panel3.Visible:=true;groupbox1.visible:=false;

Page 23: Power Point Tugas Akhir Delphi

edit1.clear;edit2.clear;edit3.clear;edit4.clear;listbox1.clear;end;procedure TForm_Matematika.FormCreate(Sender: TObject);begin{a:=1;edit9.text:=floattostr(a);edit4.text:=floattostr(a); } end;procedure TForm_Matematika.Timer1Timer(Sender: TObject);beginif label18.Font.Color=clwhite thenlabel18.Font.Color:=clyellow

elselabel18.Font.Color:=clwhite;if label19.Font.Color=clwhite thenlabel19.Font.Color:=clyellowelselabel19.Font.Color:=clwhite;if label21.Font.Color=clwhite thenlabel21.Font.Color:=clyellowelselabel21.Font.Color:=clwhite;if label22.Font.Color=clwhite thenlabel22.Font.Color:=clyellowelselabel22.Font.Color:=clwhite;if label23.Font.Color=clwhite thenlabel23.Font.Color:=clyellowelselabel23.Font.Color:=clwhite; if label24.Font.Color=clwhite thenlabel24.Font.Color:=clyellow

Page 24: Power Point Tugas Akhir Delphi

elselabel24.Font.Color:=clwhite; if label26.Font.Color=clwhite thenlabel26.Font.Color:=clyellowelselabel26.Font.Color:=clwhite; if label25.Font.Color=clwhite thenlabel25.Font.Color:=clyellowelselabel25.Font.Color:=clwhite;if label27.Font.Color=clwhite thenlabel27.Font.Color:=clyellowelselabel27.Font.Color:=clwhite;end;procedure TForm_Matematika.Timer2Timer(Sender: TObject);beginif label28.Font.Color=clyellow thenlabel28.Font.Color:=clwhite

elselabel28.Font.Color:=clyellow;if label29.Font.Color=clyellow thenlabel29.Font.Color:=clwhiteelselabel29.Font.Color:=clyellow;if label30.Font.Color=clyellow thenlabel30.Font.Color:=clwhiteelselabel30.Font.Color:=clyellow;if label31.Font.Color=clyellow thenlabel31.Font.Color:=clwhiteelselabel31.Font.Color:=clyellow;if label32.Font.Color=clyellow thenlabel32.Font.Color:=clwhiteelselabel32.Font.Color:=clyellow; if label20.Font.Color=clyellow thenlabel20.Font.Color:=clwhite

Page 25: Power Point Tugas Akhir Delphi

elselabel20.Font.Color:=clyellow;if label33.Font.Color=clyellow thenlabel33.Font.Color:=clwhiteelselabel33.Font.Color:=clyellow;if label34.Font.Color=clyellow thenlabel34.Font.Color:=clwhiteelselabel34.Font.Color:=clyellow;if label35.Font.Color=clyellow thenlabel35.Font.Color:=clwhiteelselabel35.Font.Color:=clyellow;if label36.Font.Color=clyellow thenlabel36.Font.Color:=clwhite

elselabel36.Font.Color:=clyellow;end;ProcedureTForm_Matematika.Timer3Timer

(Sender: TObject);beginlabel37.Left := label37.Left - 5; if label31.Left <= -100 then label37.Left := 550; if label37.Font.Color=cllime thenlabel37.Font.Color:=clwhiteelselabel37.Font.Color:=cllime;end;end.

Page 26: Power Point Tugas Akhir Delphi