Você está na página 1de 30

PROGRAM DELPHI MATEMATIKA

Dibuat Untuk Memenuhi Salah Satu Tugas Pada Mata Kuliah Program Komputer Dosen : Drs. Dedi Sopyan, M.Pd

Disusun Oleh : Eva Noviani Sutisna ( 09512042)


STKIP GARUT 2011

PROSEDUR FORM1 ( Splash Screen)


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM1( Splash Screen)


var form1: Tform1; a,s:integer; implementation uses U_pasword; {$R *.dfm} procedure Tform1.Timer1Timer(Sender: TObject); begin a:=a+1; if a=1 then label1.Caption:='PROGRAM DELPHI UNTUK MATEMATIKA'; if a=2 then label2.Caption:='Dibuat Untuk Memenuhi Tugas pada Mata Kuliah Program Komputer'; if a=3 then label3.Caption:='Dosen : Dedi sopyan, M.Pd'; if a=4 then label4.Caption:='SEKOLAH TINGGI KEGURUAN DAN ILMU PENDIDIKAN'; if a=5 then

begin label1.Caption:=''; label2.Caption:=''; label3.Caption:=''; label4.Caption:=''; a:=0; end; S:=S+1; if S=5 then begin Form1.Hide; Form2.Show; end; end; end.

PROSEDUR FORM2 ( Password)


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM2 ( Password)


Var form2 : Tform2; mplementation uses u_identitaspenyusun; {$R *.dfm} procedure Tform2.BitBtn1Click(Sender: TObject); begin if edit1.text=edit2.text then close else begin messagedlg('Password Anda Salah'+chr(10)+chr(13)+'Coba anda Ulangi',mtinformation,[mbOk],0); end; form2.Hide; form3.show; end; end.

PROSEDUR FORM3 ( Identitas)


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM3 ( Identitas)


var Form3: TForm3; implementation uses u_kalkulator, u_InputData, u_persegi, u_PersegiPanjang, u_Lingkaran, u_Exit; {$R *.dfm} procedure TForm3.About1Click(Sender: TObject); begin form9.show; end; procedure TForm3.InputData1Click(Sender: TObject); begin form5.show; end;
procedure TForm3.Kalkulator1Click(Sender:

TObject); begin form4.show; end; procedure TForm3.Lingkaran1Click(Sender: TObject); begin form8.show; end; procedure TForm3.Persegi1Click(Sender: TObject); begin form6.show; end;

PROSEDUR FORM3 ( Identitas)


Procedure TForm3.PersegiPanjang1Click(Sender: TObject); begin form7.show; end; procedure TForm3.Timer1Timer(Sender: TObject); begin Label1.Font.Color:=clblue; Timer1.Enabled:=False; Timer2.Enabled:=True; end; procedure TForm3.Timer2Timer(Sender: TObject); begin Label1.Font.color:=clRed; Timer1.Enabled:=true; Timer2.Enabled:=false; end; end.

PROSEDUR FORM4 ( KALKULATOR)


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM4 ( Kalkulator)


form 4 var Form4: TForm4; implementation {$R *.dfm} procedure TForm4.BitBtn1Click(Sender: TObject); begin Edit1.Clear; Edit2.Clear; Edit3.Clear; end; procedure TForm4.BitBtn2Click(Sender: TObject); begin Close; end;
procedure TForm4.Button1Click(Sender: TObject); var a,b,c:real; begin a:=Strtofloat(Edit1.Text); b:=Strtofloat(Edit2.Text); c:=a+b; Edit3.Text:=Floattostr(c); end; procedure TForm4.Button2Click(Sender: TObject); var a,b,c:real; begin a:=Strtofloat(Edit1.Text); b:=Strtofloat(Edit2.Text); c:=a-b; Edit3.Text:=Floattostr(c); End;

PROSEDUR FORM4( kalkulator)


procedure TForm4.Button3Click(Sender: TObject); var a,b,c:real; begin a:=Strtofloat(Edit1.Text); b:=Strtofloat(Edit2.Text); c:=a*b; Edit3.Text:=Floattostr(c); end; procedure TForm4.Button4Click(Sender: TObject); var a,b,c:real; begin a:=Strtofloat(Edit1.Text); b:=Strtofloat(Edit2.Text); c:=a/b; Edit3.Text:=Floattostr(c); end; procedure TForm4.Button5Click(Sender: TObject); Var a,i,f:integer; begin a:=Strtoint(Edit1.Text); f:=1; for i:=1 to a do f:=f*i; Edit3.Text:=Inttostr(f); Edit2.Text:=''; end; procedure TForm4.Button6Click(Sender: TObject); Var a,b:Real; begin a:=strtofloat(Edit1.Text); b:=exp(2*ln(a)); Edit3.Text:=Floattostr(b); Edit2.Text:=''; end;

PROSEDUR FORM4 ( Kalkulator)


procedure TForm4.Button7Click(Sender: TObject); Var a,b,c:Real; begin a:=strtofloat(Edit1.Text); b:=strtofloat(Edit2.Text); c:=exp(b*ln(a)); Edit3.Text:=Floattostr(c); end; procedure TForm4.Button8Click(Sender: TObject); procedure TForm4.Button9Click(Sender: TObject); Var a,b:real; begin a:=strtofloat(edit1.Text); b:=sin((a*pi)/180); edit3.Text:=floattostr(b); edit2.Text:=''; end; End procedure TForm4.Button10Click(Sender: TObject); Var a,b:real; begin a:=strtofloat(edit1.Text); b:=cos((a*pi)/180); edit3.Text:=floattostr(b); edit2.Text:='' End;

Vara,b,c:Real; begin a:=strtofloat(Edit1.Text); b:=sqr(a); Edit3.Text:=Floattostr(c); Edit2.Text:=''; end; .

PROSEDUR FORM4
procedure TForm4.Button11Click(Sender: TObject); Var a,b:real; begin a:=strtofloat(edit1.Text); b:=sin((a*pi)/180)/cos((a*pi)/180); edit3.Text:=floattostr(b); edit2.Text:=''; end; procedure TForm4.Button12Click(Sender: TObject); Var x,z:real; begin x:=Strtoint(Edit1.Text); z:=ln(x); Edit3.Text:=floattostr(z); Edit2.Text:=''; end; procedure TForm4.Button13Click(Sender: TObject); Var a,b,c:real; begin a:=strtofloat(edit1.Text); b:=strtofloat(edit2.Text); c:=ln(b)/ln(a); Edit3.Text:=floattostr(c); end; procedure TForm4.Button14Click(Sender: TObject); var a,b,i,n,r,z,j:integer; t:real; begin a:=strtoint(Edit1.Text); b:=strtoint(edit2.Text); n:=1; r:=1; j:=a-b; for i:=1 to a do n:=1*n; begin for i:=1 to j do r:=1*r; end; t:=n/r; Edit3.text:=floattostr(t); if a < b then edit3.text:='Error'; end;

PROSEDUR FORM4 ( Kalkulator)


procedure TForm4.Button15Click(Sender: TObject); Var a,b,i,n,r,z,j:integer; t:real; begin a:=strtoint(Edit1.Text); b:=strtoint(edit2.text); n:=1; r:=1; z:=1; j:=a-b; for i:=1 to j do n:=i*n; begin for i:=1 to j do r:=i*n; end; end; Begin for i:=1 to b do z:=i*z; End; t:=n/(z*r); Edit3.text:=floattostr(t); if a < b then edit3.Text:='Error'; end; procedure TForm4.Button16Click(Sender: TObject); var a,b:real; begin a:=strtoint(edit1.Text); b:=exp((1/2)*ln(a)); edit3.Text:=floattostr(b); Edit2.Text:='';

PROSEDUR FORM5 ( Input Data)


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM5 ( Input Data)


var Form5: TForm5; s :string; p,i :integer; no :array[1..100] of string; nama :array[1..100] of string; nim :array[1..100] of string; email :array[1..100] of string; nope :array[1..100] of string; implementation {$R *.dfm} procedure TForm5.BitBtn1Click(Sender: TObject); begin s:=inputbox('Loop','Perulangan',''); p:=strtoint(s); stringgrid1.Cells[0,0]:='No'; stringgrid1.Cells[1,0]:='Nama'; stringgrid1.Cells[2,0]:='NIM'; stringgrid1.Cells[3,0]:='Email'; stringgrid1.Cells[4,0]:='Nope'; for i :=1 to p do
begin no[i]:=inputbox('ID','No',''); nama[i]:=inputbox('ID','Nama',''); nim[i]:=inputbox('ID','NIM',''); email[i]:=inputbox('ID','Email',''); nope[i]:=inputbox('ID','Nope',''); listbox1.Items.Add(' listbox1.Items.Add(' Hasil Akhir ');

');

listbox1.Items.Add('========================== ======='); listbox1.Items.Add(inttostr(i)+'. '+nama[i]); listbox1.Items.Add(' '+nim[i]); listbox1.Items.Add(' '+email[i]); listbox1.Items.Add(' '+nope[i]); listbox1.Items.Add(' '); listbox1.Items.Add('-----------------------------------------------'); stringgrid1.cells[0,i]:=no[i]; stringgrid1.Cells[1,i]:=nama[i]; stringgrid1.Cells[2,i]:=nim[i]; stringgrid1.cells[3,i]:=email[i]; stringgrid1.Cells[4,i]:=nope[i]; end; end;

PROSEDUR FORM6 ( Persegi )


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM6 ( Persegi)


var Form6: TForm6; a,b : integer; s:array[1..100] of real; K:array[1..100] of real; LU:array[1..100] of real; implementation {$R *.dfm} procedure TForm6.Bitbtn1Click(Sender: TObject); begin b:=strtoint(edit1.Text); if a<=b then s[a]:=strtoint(edit3.Text); K[a]:=4*s[a]; LU[a]:=s[a]*s[a]; listbox1.Items.add('========================================'); listbox1.Items.add(' DATA KE '+inttostr(a)); listbox1.Items.add('========================================'); listbox1.Items.add(' Sisi (s) '+'= '+floattostr(s[a])); listbox1.Items.add('---------------------------------------------------------');

PROSEDUR FORM6( Persegi)


listbox1.Items.add(' Luas Persegi : '); listbox1.Items.add(' L = s x s '); listbox1.Items.add(' = '+floattostr(s[a])+' x '+floattostr(s[a]) ); listbox1.Items.add(' = '+floattostr(LU[a])); listbox1.Items.add(' Keliling Persegi : '); listbox1.Items.add(' K = 4 x s '); listbox1.Items.add(' = '+'4 x '+ floattostr(s[a]) ); listbox1.Items.add(' = '+floattostr(K[a])); listbox1.Items.add('---------------------------------------------------------'); listbox1.Items.add(''); edit3.SetFocus; if a<b then begin a:=a+1; edit2.Text:=inttostr(a); end else if a=b then messageDlg('Stop, Data Bilangan Sudah '+inttostr(b)+' Buah !!',mtInformation,[mbYes],0); bitbtn2.enabled:=true; end;

PROSEDUR FORM6 ( Persegi)


procedure TForm6.Bitbtn2Click(Sender: TObject);

begin a:=1; edit2.Text:=inttostr(a); edit1.clear; edit3.clear; listbox1.Clear; bitbtn1.Enabled:=false; bitbtn2.Enabled:=false; edit1.SetFocus; end; procedure TForm6.Bitbtn3Click(Sender: TObject); begin close; end; procedure TForm6.FormCreate(Sender: TObject); begin a:=1; edit2.Text:=inttostr(a); end; end.

PROSEDUR FORM7( PERSEGI PANJANG)


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM7 ( PERSEGI PANJANG)


var Form7: TForm7; a,b : integer; p:array[1..100] of real; l:array[1..100] of real; K:array[1..100] of real; LU:array[1..100] of real; implementation {$R *.dfm} procedure TForm7.Bitbtn4Click(Sender: TObject); begin b:=strtoint(edit4.Text); if a<=b then p[a]:=strtoint(edit6.Text); l[a]:=strtoint(edit7.Text); K[a]:=2*(p[a]+l[a]); LU[a]:=p[a]*l[a];

PROSEDUR FORM7 ( Persegi Panjanng)


listbox1.Items.add('==============================='); listbox1.Items.add(' DATA KE '+inttostr(a)); listbox1.Items.add('==============================='); listbox1.Items.add(' Panjang ( p ) = '+floattostr(p[a])); listbox1.Items.add(' Lebar ( l ) = '+floattostr(l[a])); listbox1.Items.add('---------------------------------------------------------'); listbox1.Items.add(' Luas Persegi Panjang : '); listbox1.Items.add(' L = p x l '); listbox1.Items.add(' = '+floattostr(p[a])+' x '+floattostr(l[a]) ); listbox1.Items.add(' = '+floattostr(LU[a])); listbox1.Items.add(' Keliling Persegi Panjang :'); listbox1.Items.add(' K = 2 x ( p + l ) '); listbox1.Items.add(' = '+'2'+ 'x'+' (' +floattostr(p[a])+' + '+floattostr(l[a])+' )'); listbox1.Items.add(' = '+floattostr(K[a])); listbox1.Items.add('---------------------------------------------------------'); listbox1.Items.add(''); edit6.SetFocus; if a<b then

PROSEDUR FORM7 (Persegi Panjang)


begin a:=a+1; edit5.Text:=inttostr(a); end else if a=b then messageDlg('Stop, Data Bilangan Sudah '+inttostr(b)+' Buah !! ',mtInformation,[mbYes],0); bitbtn4.enabled:=true; end; procedure TForm7.Bitbtn5Click(Sender: TObject); begin a:=1; edit5.Text:=inttostr(a); edit4.clear; edit6.clear; edit7.Clear; listbox1.Clear; bitbtn4.Enabled:=false; bitbtn5.Enabled:=false; edit5.SetFocus; end; procedure TForm7.Bitbtn6Click(Sender: TObject); begin close; end; procedure TForm7.FormCreate(Sender: TObject); begin a:=1; edit5.Text:=inttostr(a); end; end.

PROSEDUR FORM8 (LINGKARAN)


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM8 ( LINGKARAN)


var Form8: TForm8; a,b : integer; r:array[1..100] of real; K:array[1..100] of real; LU:array[1..100] of real; implementation {$R *.dfm} procedure TForm8.Bitbtn7Click(Sender: TObject); begin b:=strtoint(edit8.Text); if a<=b then r[a]:=strtoint(edit10.Text); K[a]:=3.14*2*r[a]; LU[a]:=3.14*r[a]*r[a];

PROSEDUR FORM8

( LINGKARAN)

listbox1.Items.add('==============================='); listbox1.Items.add(' DATA KE '+inttostr(a)); listbox1.Items.add('==============================='); listbox1.Items.add(' jari-jari ( r ) '+'= '+floattostr(r[a])); listbox1.Items.add('---------------------------------------------------------'); listbox1.Items.add(' Luas Lingkaran : '); listbox1.Items.add(' L = x r^2 '); listbox1.Items.add(' = '+' 3,14 x '+floattostr(r[a])+' ^2 '); listbox1.Items.add(' = '+floattostr(LU[a])); listbox1.Items.add(' Keliling Lingkaran :'); listbox1.Items.add(' K = 2 r '); listbox1.Items.add(' = 2 x 3,14 x '+floattostr(r[a])); listbox1.Items.add(' = '+floattostr(K[a])); listbox1.Items.add('---------------------------------------------------------'); listbox1.Items.add(''); edit10.SetFocus; if a<b then

PROSEDUR FORM8 ( LINGKARAN)


begin a:=a+1; edit9.Text:=inttostr(a); end else if a=b then messageDlg('Stop, Data Bilangan Sudah '+inttostr(b)+' Buah !!',mtInformation,[mbYes],0); bitbtn8.enabled:=true; end; procedure TForm8.Bitbtn8Click(Sender: TObject); begin a:=1; edit9.Text:=inttostr(a); edit8.clear; edit10.clear; listbox1.Clear; bitbtn7.Enabled:=false; bitbtn8.Enabled:=false; edit9.SetFocus; end;

procedure TForm8.Bitbtn9Click(Sender: TObject); begin close; end; procedure TForm8.FormCreate(Sender: TObject); begin a:=1; edit9.Text:=inttostr(a); end; end.

PROSEDUR FORM9 ( Exit)


Sebelum Di Run Sesudah Di Run

PROSEDUR FORM9( Exit)


var Form9: TForm9; implementation uses u_identitaspenyusun; {$R *.dfm} procedure TForm9.BitBtn1Click(Sender: TObject); begin application.Terminate; end; procedure TForm9.BitBtn2Click(Sender: TObject); begin form3.show; end; end.