program komputer delphi -aplikasi matematika-

31
Biodata dan Aplikasi Matematika Menggunakan Delphi Disusun oleh: Mansurah Ma’sum (09511002) 2-A Jurusan Pendidikan Matematika STKIP GARUT 2011

Upload: mansurah-masum

Post on 27-Nov-2014

125 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Program Komputer Delphi -aplikasi matematika-

Biodata danAplikasi MatematikaMenggunakan Delphi

Disusun oleh:Mansurah Ma’sum

(09511002)2-A

Jurusan Pendidikan Matematika STKIP GARUT

2011

Page 2: Program Komputer Delphi -aplikasi matematika-

Main Menu

Biodata Matematika

Akar-akar Suku

BanyakFungsi Derajat Tiga

Fungsi Derajat Empat

Keluar

Page 3: Program Komputer Delphi -aplikasi matematika-

Form 1: mainmenuSebelum di-run

Setelah di-run

Page 4: Program Komputer Delphi -aplikasi matematika-

Komponen Palet Form 1

no Komponen Palet properti

1 Image1 Visible: true

2 Label1 Caption: ‘Fun Math’ Visible: true

3 Mainmenu1 a) Biodatab) Matematika

• Akar-Akar Suku BanyakFungsi Derajat TigaFungsi Derajat Tiga

c) Keluar

4 Timer1 Enable: trueInterval :20

5 Mediaplayer1 AutoOpen: true

Page 5: Program Komputer Delphi -aplikasi matematika-

Listing program:

var

Form1: TForm1;

implementation

uses U_biodata, U_fungsi3, U_fungsi4;

{$R *.dfm}

procedure TForm1.biodata1Click(Sender: TObject);

begin

form3.showmodal;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

mediaplayer1.play;

end;

procedure TForm1.FungsiDerajatEmpat1Click(Sender: TObject);

begin

form6.showmodal;

end;

procedure TForm1.FungsiDerajatTiga1Click(Sender: TObject);

begin

form5.showmodal;

end;

procedure TForm1.Keluar1Click(Sender: TObject);

begin

application.Terminate;

end;

procedure TForm1.Timer1Timer(Sender: TObject);

begin

if label1.top <> 370 then

begin;

label1.top := label1.top -1;

end

else

begin

if label1.Font.Color=clwhite then

label1.Font.Color:=clblack

else

label1.Font.Color:=clwhite;

timer1.interval:=1000;

end;

end;

end.

Page 6: Program Komputer Delphi -aplikasi matematika-

Form2: splash screen

Sebelum di-run Setelah di-run

Page 7: Program Komputer Delphi -aplikasi matematika-

Komponen Palet form 2

No Komponen Palet

Properti

1 image1 Visible: true

2 image2 Visible: true

3 timer1 Enable: trueInterval :20

Page 8: Program Komputer Delphi -aplikasi matematika-

Listing program:

var Form2: TForm2;implementation{$R *.dfm}

procedure TForm2.Timer1Timer(Sender: TObject);

beginif image2.left <> 335 thenimage2.left := image2.left -1elsebegintimer1.Enabled := false;

end;end;end.

Page 9: Program Komputer Delphi -aplikasi matematika-

Form 3: Biodata 1

Sebelum di-run:

Setelah di-run:

Page 10: Program Komputer Delphi -aplikasi matematika-

Komponen Palet Form3

No Komponen Palet

Properti

1 image1 Visible: true

2 speedbutton1 Caption: ‘ ’Cursor: crhandpointFlat: trueHint: click!!!Showhint: true

Page 11: Program Komputer Delphi -aplikasi matematika-

Listing program:var Form3: TForm3;implementation

uses U_bio2;{$R *.dfm}

procedure TForm3.SpeedButton1Click(Sender: TObject);

beginform4.showmodal;end;

end.

Page 12: Program Komputer Delphi -aplikasi matematika-

Form 4: Biodata 2Sebelum di-run Setelah di-run

Page 13: Program Komputer Delphi -aplikasi matematika-

Komponen Palet Form 4:No Komponen Palet Properti

1 bitbutton1 Cursor: crhandpointKind: bkcloseVisible: true

2 button1 Caption: ‘comment’Cursor: crhandpointVisible: true

3 button2 Caption: ‘comment’Cursor: crhandpointVisible: true

4 Groupbox1• panel1-panel5

Caption: ‘ ‘Visible: false

5 image1 Stretch: trueVisible: true

6 label1 Caption: ‘eehh teman-teman, jangan cuma ngliatin aja ‘

Visible: false

Page 14: Program Komputer Delphi -aplikasi matematika-

Komponen Palet

7 label2 Caption: ‘comment juga dong!!!!‘Visible: false

8 listbox1 Visible: false

9 speedbutton1 Caption: ‘ ’Cursor: crhandpointFlat: true

10 timer1 Enabled: trueInterval: 2000

11 timer2 Enabled: trueInterval: 2000

Page 15: Program Komputer Delphi -aplikasi matematika-

listing program:

var

Form4: TForm4;

s:string;

nama:array[1..20] of string;

komentar:array[1..20] of string;

i: integer;

implementation

{$R *.dfm}

procedure TForm4.Button1Click(Sender: TObject);

begin

listbox1.Visible:=true;

for i:=1 to 1 do

begin

Nama[i]:=inputbox('Nama','nama kamu ???','');

komentar[i]:=inputbox('cOmment','cOmmentnya gimana ??','');

listbox1.Items.Add(nama[i]+' : '+komentar[i]);

end;

end;

procedure TForm4.Button2Click(Sender: TObject);

begin

groupbox1.Visible:=false;

listbox1.Visible:=false;

end;

procedure TForm4.SpeedButton1Click(Sender: TObject);

begin

groupbox1.Visible:=true;

panel1.Visible:=true;

panel2.Visible:=true;

panel3.Visible:=true;

panel4.Visible:=true;

panel5.Visible:=true;

panel1.caption:='Mansurah, Masum,call me Suroh';

panel2.caption:='Nim: 09511002';

panel3.caption:='lahir di Medan, 29 Agustus 1991';

panel4.caption:='No. Hp 085295251312';

panel5.caption:='email: [email protected]';

end;

Page 16: Program Komputer Delphi -aplikasi matematika-

Lanjutan listing program:

procedure TForm4.Timer1Timer(Sender: TObject);

begin

if label1.Font.Color=clwhite then

label1.Font.Color:=clblack

else

label1.Font.Color:=clwhite;;

end;

procedure TForm4.Timer2Timer(Sender: TObject);

begin

if label2.Font.Color=clblack then

label2.Font.Color:=clwhite

else

label2.Font.Color:=clblack;

end;

end.

Page 17: Program Komputer Delphi -aplikasi matematika-

Sebelum di-run

Setelah di-run

Form 5: Fungsi Derajat Tiga

Page 18: Program Komputer Delphi -aplikasi matematika-

Setelah di-run

Page 19: Program Komputer Delphi -aplikasi matematika-

Komponen Palet Form 5:No Komponen Palet Properti

1 bitbutton1 Cursor: crhandpointKind: bkcloseVisible: false

2 button1 Caption: ‘akar-akar suku banyak’Cursor: crhandpointStyle: bscommandlinkVisible: true

3 button2 Caption: inputCursor: crhandpointVisible: false

4 button3 Caption: UlangCursor: crhandpointVisible: false

5 image1 Visible: true

6 image2 Stretch: trueVisible: false

Page 20: Program Komputer Delphi -aplikasi matematika-

7 label1 Caption: ‘Fungsi Derajat Tiga’Visible: false

8 label5 Caption: ‘klik akar-akar suku banyak untuk menghitung akar-akar suku banyak! ‘

Visible: true

9 listbox1 Visible: false

10 Panel1•Edit 1-edit3•Label2-label4

Caption: ‘ ‘Visible: false

11 timer1 Enabled: falseInterval: 1000

12 timer2 Enabled: trueInterval: 200

Page 21: Program Komputer Delphi -aplikasi matematika-

Listing Program: vara: array [1..4] of string;b: array [1..4] of string;c: array [1..4] of string;d: array [1..4] of string; s:string;implementation

{$R *.dfm}

procedure TForm5.Button1Click(Sender: TObject);

beginimage1.Visible:=false;button1.Visible:=false;image2.Visible:=true;panel1.Visible:=true;listbox1.Visible:=true;button2.Visible:=true;button3.Visible:=true;bitbtn1.Visible:=true;label1.Visible:=true;timer1.Enabled:=true;timer2.Enabled:=false;end;

procedure TForm5.Button2Click(Sender: TObject);

type nilai=recorda:integer;b:integer;c:integer;d:integer;end;

varN:array[1..4] of nilai;i: integer;e,f,g:real;beginfor i:=1 to 1 dobeginN[i].a:=strtoint(inputbox('input

bilangan','Masukkan Nilai a',''));N[i].b:=strtoint(inputbox('input

bilangan','Masukkan Nilai b',''));N[i].c:=strtoint(inputbox('input

bilangan','Masukkan Nilai c',''));N[i].d:=strtoint(inputbox('input

bilangan','Masukkan Nilai d',''));

Page 22: Program Komputer Delphi -aplikasi matematika-

Lanjutan Listing Program:e:=-N[i].b/N[i].a;f:=N[i].c/N[i].a;g:=-N[i].d/N[i].a;

edit1.Text:=floattostr(e);edit2.Text:=floattostr(f);edit3.Text:=floattostr(g);end;for i:=1 to 1 dobeginlistbox1.Items.add('a ='+inttostr(N[i].a)+' b

='+inttostr(N[i].b)+' c ='+inttostr(N[i].c)+' d ='+inttostr(N[i].d));

listbox1.Items.add('--------------------------------------------------------------------------------------------------------------');

end;end;

procedure TForm5.Button3Click(Sender: TObject);

beginbeginlistbox1.Clear;edit1.clear;edit2.clear;edit3.clear;end;end;

procedure TForm5.Timer1Timer(Sender: TObject);

begin if label1.visible=true thenlabel1.visible:=falseelselabel1.visible:=true;

end;

procedure TForm5.Timer2Timer(Sender: TObject);

begin label5.left := label5.left - 5; if label5.left <= -100 then label5.left := 550;end;

end.

Page 23: Program Komputer Delphi -aplikasi matematika-

Sebelum di-run

Setelah di-run

Form6: fungsi derajat empat

Page 24: Program Komputer Delphi -aplikasi matematika-

Setelah di-run:

Page 25: Program Komputer Delphi -aplikasi matematika-

Komponen Palet Form 6No Komponen Palet Properti

1 bitbutton1 Cursor: crhandpointKind: bkcloseVisible: false

2 button1 Caption: akar-akar suku banyakCursor: crhandpointStyle: bscommandlinkVisible: true

3 button2 Caption: inputCursor: crhandpointVisible: false

4 button3 Caption: UlangCursor: crhandpointVisible: false

5 image1 Visible: true

6 image2 Stretch: trueVisible: false

Page 26: Program Komputer Delphi -aplikasi matematika-

7 label1 Caption: ‘Fungsi Derajat Empat ‘Visible: false

8 label5 Caption: ‘klik akar-akar suku banyak untuk menghitung akar-akar suku banyak! ‘

Visible: true

9 listbox1 Visible: false

10 Panel1•Edit 1-edit4•Label2-label5

Caption: ‘ ‘Visible: false

11 timer1 Enabled: falseInterval: 1000

12 timer2 Enabled: trueInterval: 200

Page 27: Program Komputer Delphi -aplikasi matematika-

Listing program

var Form6: TForm6;a: array [1..4] of string;b: array [1..4] of string;c: array [1..4] of string;d: array [1..4] of string;e: array [1..4] of string;

s:string;implementation

{$R *.dfm}

procedure TForm6.Button1Click(Sender: TObject);

beginimage1.Visible:=false;button1.Visible:=false;image2.Visible:=true;panel1.Visible:=true;button2.Visible:=true;button3.Visible:=true;bitbtn1.Visible:=true;label1.Visible:=true;timer1.Enabled:=true;timer2.Enabled:=false;end;

procedure TForm6.Button2Click(Sender: TObject);

type nilai=recorda:integer;b:integer;c:integer;d:integer;e:integer;end;varN:array[1..5] of nilai;i: integer;e,f,g,h:real;beginlistbox1.Visible:=true;for i:=1 to 1 dobeginN[i].a:=strtoint(inputbox('input

bilangan','Masukkan Nilai a',''));N[i].b:=strtoint(inputbox('input

bilangan','Masukkan Nilai b',''));N[i].c:=strtoint(inputbox('input

bilangan','Masukkan Nilai c',''));N[i].d:=strtoint(inputbox('input

bilangan','Masukkan Nilai d',''));N[i].e:=strtoint(inputbox('input

bilangan','Masukkan Nilai e',''));

Page 28: Program Komputer Delphi -aplikasi matematika-

e:=-N[i].b/N[i].a;f:=N[i].c/N[i].a;g:=-N[i].d/N[i].a;h:=N[i].e/N[i].a;

edit1.Text:=floattostr(e);edit2.Text:=floattostr(f);edit3.Text:=floattostr(g);edit4.Text:=floattostr(h);

end;for i:=1 to 1 dobeginlistbox1.Items.add('Nilai a

='+inttostr(N[i].a));listbox1.Items.add('Nilai b

='+inttostr(N[i].b));listbox1.Items.add('Nilai c

='+inttostr(N[i].c));listbox1.Items.add('Nilai d

='+inttostr(N[i].d));listbox1.Items.add('Nilai e

='+inttostr(N[i].e));listbox1.Items.add('-------------------');end;end;

procedure TForm6.Button3Click(Sender: TObject);

beginedit1.clear;edit2.clear;edit3.clear;edit4.clear;listbox1.Clear;listbox1.Visible:=false;end;

procedure TForm6.Timer1Timer(Sender: TObject);

begin label1.left := label1.left - 5; if label1.left <= -100 then label1.left := 550;end;

procedure TForm6.Timer2Timer(Sender: TObject);

begin label6.left := label6.left - 5; if label6.left <= -100 then label6.left := 550;end;end.

Page 29: Program Komputer Delphi -aplikasi matematika-

program P_pertama;

uses Forms, U_Pertama in 'U_Pertama.pas'

{Form1}, U_splash in 'U_splash.pas' {Form2}, U_biodata in 'U_biodata.pas' {Form3}, U_bio2 in 'U_bio2.pas' {Form4}, U_fungsi3 in 'U_fungsi3.pas' {Form5}, U_fungsi4 in 'U_fungsi4.pas' {Form6};

{$R *.res}

Project:

Page 30: Program Komputer Delphi -aplikasi matematika-

Lanjutan:beginForm2 := TForm2.Create(Application);Form2.Show;Form2.Update;while Form2.Timer1.Enabled doApplication.ProcessMessages;form2.Hide;Form2.Free; // menghapus form splash

scren dr memoryApplication.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm1, Form1); Application.CreateForm(TForm3, Form3); Application.CreateForm(TForm4, Form4); Application.CreateForm(TForm5, Form5); Application.CreateForm(TForm6, Form6); Application.Run;

end.

Page 31: Program Komputer Delphi -aplikasi matematika-

Terima kasih…….