TUGAS PROGRAM DELPHI ¶·ARRAYµ BIODATA DAN PERSAMAAN LINGKARAN Diajukan untuk memenuhi tugas Program Komputer yang

dibimbing oleh Drs. Deddy Sofyan M.Pd. M.Pd.

Disusun oleh : Neng Resa Fujianti (09511025) SEKOLAH TINGGI KEGURUAN DAN ILMU PENDIDIKAN STKIP (GARUT) 2011

Password
Tampilan Sebelum di Run Tampilan Setelah di Run

Listing Program
procedure TForm1.BitBtn1Click(Sender: TObject); begin if edit1.text=('2906') then begin form2.ProgressBar1.Position := 0; form2.Timer1.Enabled := true; form2.Visible:=true; end else messagedlg('password Anda Salah'+chr(10)+chr(13)+'Coba Anda Ulangi',mtinformation,[mbOK],0); end; end.

Loading
Tampilan Sebelum di Run Tampilan Setelah di Run

Listing Program
procedure TForm2.Timer1Timer(Sender: TObject); begin if progressbar1.Position <> 100 then progressbar1.position:=progressbar1.position+1 else begin timer1.Enabled:=false; form1.visible:=false; form2.Visible:=false; form3.visible:=true; end; end; procedure TForm2.Timer2Timer(Sender: TObject); Begin if label1.top=5 then label1.top:=100; Label1.top:=Label1.top-3; end;

procedure TForm2.Timer3Timer(Sender: TObject); begin if label1.Font.Color=clPurple then label1.Font.Color:=cllime else label1.Font.Color:=clPurple; end; procedure TForm2.Timer4Timer(Sender: TObject); begin if progressbar1.Position <> 100 then progressbar1.position:=progressbar1.position+1 else begin timer4.Enabled:=false; form4.visible:=true; form2.Visible:=false; end; end;

procedure TForm2.Timer5Timer(Sender: TObject); begin if progressbar1.Position <> 100 then progressbar1.position:=progressbar1.positi on+1 else begin timer5.Enabled:=false; form5.visible:=true; form2.Visible:=false; end; end; procedure TForm2.Timer6Timer(Sender: TObject); begin if progressbar1.Position <> 100 then progressbar1.position:=progressbar1.positi on+1 else

begin timer6.Enabled:=false; form6.visible:=true; form2.Visible:=false; end; end; procedure TForm2.Timer7Timer(Sender: TObject); begin if progressbar1.Position <> 100 then progressbar1.position:=progressbar1.positi on+1 else begin timer7.Enabled:=false; form7.visible:=true; form2.Visible:=false; end; end; end.

MainMenu
Tampilan Sebelum di Run Tampilan Setelah di Run

Listing Program
procedure TForm3.BentukPersamaanLingkaran1Click(Sender: TObject); begin form2.ProgressBar1.Position := 0; form2.Timer5.Enabled := true; form2.Visible:=true; end; procedure TForm3.Biodata1Click(Sender: TObject); begin form2.ProgressBar1.Position := 0; form2.Timer4.Enabled := true; form2.Visible:=true; end;

procedure TForm3.Keluar1Click(Sender: TObject); begin application.Terminate; end; procedure TForm3.LingkaranYangBerpusatdititik001Click(Sender: TObject); begin form2.ProgressBar1.Position := 0; form2.Timer6.Enabled := true; form2.Visible:=true; end; procedure TForm3.LingkaranYangBerpusatdiTitikhk1Click(Sender: TObject); begin form2.ProgressBar1.Position := 0; form2.Timer7.Enabled := true; form2.Visible:=true; end; end.

Biodata
Tampilan Sebelum di Run Tampilan Setelah di Run

Listing Program
var Form4: TForm4; beratbadan,tinggibadan:array[1..20] of integer; a:real; kriteria:string; i:integer; implementation {$R *.dfm} procedure TForm4.BitBtn1Click(Sender: TObject); var no:array[1..25] of string; nama:array[1..20] of string; alamat:array[1..20] of string; jeniskelamin:array[1..20] of string; umur:array[1..25] of string; beratbadan,tinggibadan:array[1..20] of string; begin stringgrid1.Cells[0,0]:='No'; stringgrid1.Cells[1,0]:='Nama'; stringgrid1.Cells[2,0]:='Alamat'; stringgrid1.Cells[3,0]:='Jenis Kelamin'; stringgrid1.Cells[4,0]:='Umur'; begin for i := 1 to 1 do begin no[i]:=inputbox('ID','No',''); nama[i]:=inputbox('ID','Nama','');

alamat[i]:=inputbox('ID','Alamat',''); jeniskelamin[i]:=inputbox('ID','Jenis Kelamin',''); umur[i]:=inputbox('ID','Umur',''); listbox1.Items.Add( 'No' +''+'Nama' +''+'Alamat' +''+'Jenis Kelamin' +''+'Umur'); listbox1.Items.Add(inttostr(i)+''+no[i] +''+nama[i] +''+alamat[i] +''+jeniskelamin[i] +''+umur[i]); listbox1.items.add('=========================================================='); listbox1.items.add(' '); stringgrid1.Cells[0,i]:=no[i]; stringgrid1.Cells[1,i]:=nama[i]; stringgrid1.Cells[2,i]:=alamat[i]; stringgrid1.Cells[3,i]:=jeniskelamin[i]; stringgrid1.Cells[4,i]:=umur[i]; end; end; end; procedure TForm4.BitBtn2Click(Sender: TObject); Begin for i := 1 to 1 do

begin beratbadan[i]:=strtoint(InputBox('Berat Badan Anda','Masukkan Berat Badan Anda','')); edit1.Text:=inttostr(beratbadan[i]); tinggibadan[i]:=strtoint(InputBox('Tinggi Badan Anda','Masukkan Tinggi Badan Anda','')); edit2.Text:=inttostr(tinggibadan[i]); listbox1.Items.Add('Tinggi Badan Anda :'+inttostr(tinggibadan[i])+('cm')); listbox1.Items.add('Berat Badan Anda : '+IntTostr(beratbadan[i])+('kg')); a:=(tinggibadan[i]-100)(10/100*(tinggibadan[i]-100)); edit3.Text:=floattostr(a); listbox1.items.add('Berat Badan Ideal Anda : '+floattostr(a)+('kg'));

if a<beratbadan[i] then begin kriteria:='OBESITAS'; listbox1.items.add('Kriteria '+(kriteria)); listbox1.items.add(' '); listbox1.items.add('=========================== ==============================='); listbox1.items.add(' '); listbox1.Items.add('__Maaf Berat Badan Anda Belum Ideal__'); listbox1.items.add(' '); listbox1.items.add('__Anda Harus Menurunkan Berat Badan__'); listbox1.items.add(' '); listbox1.items.add('=========================== ==============================='); label5.Caption:='Maaf Berat Badan Anda Belum Ideal'; end :

else if a=beratbadan[i] then begin kriteria:='IDEAL'; listbox1.items.add('Kriteria '+(kriteria)); listbox1.items.add(' '); listbox1.items.add('========================== ================================'); listbox1.items.add(' '); listbox1.Items.add('__Berat Badan Anda Sudah Ideal__'); listbox1.items.add(' '); listbox1.items.add('========================== ================================'); label5.Caption:='Berat Badan Anda Sudah Ideal'; end. else if a>beratbadan[i] then :

begin kriteria:='KURUS'; listbox1.items.add('Kriteria '+(kriteria)); listbox1.items.add(' '); listbox1.items.add('=========================== ==============================='); listbox1.items.add(' '); listbox1.Items.add('__Maaf Berat Badan Anda Belum Ideal__'); listbox1.items.add(' '); listbox1.items.add('__Anda Harus Menaikkan Berat Badan__'); listbox1.items.add(' '); listbox1.items.add('=========================== ==============================='); label5.Caption:='Maaf Berat Badan Anda Belum Ideal'; end; end; end; :

procedure TForm4.BitBtn3Click(Sender: TObject); var i:integer; begin for i := 1 to 1 do begin stringgrid1.Cells[0,i]:=''; stringgrid1.Cells[1,i]:=''; stringgrid1.Cells[2,i]:=''; stringgrid1.Cells[3,i]:=''; stringgrid1.Cells[4,i]:=''; listbox1.Clear; label5.Visible:=false; edit1.Clear; edit2.Clear; edit3.Clear; end; end;

procedure TForm4.BitBtn4Click(Sender: TObject); begin close; end; procedure TForm4.Timer1Timer(Sender: TObject); begin label1.Left := label1.Left - 5; if label1.Left <= -100 then label1.Left := 550; end; end.

Bentuk Umum Persamaaan Lingkaran
Tampilan Sebelum di Run Tampilan Setelah di Run

Listing Program
var Form5: TForm5; i:integer; r:real; A:array[0..100]of integer; B:array[0..100]of integer; C:array[0..100]of integer; x:array[0..100]of real; y:array[0..100]of real; implementation uses u_mat2; {$R *.dfm} procedure TForm5.BitBtn1Click(Sender: TObject); begin listbox1.Items.Add('Bentuk persamaan lingkarannya adalah :X^2 + Y^2 +'+form5.edit1.Text+'X'+''+'+'+form5.edit2.Te xt+'X'+''+'+'+form5.edit3.Text); begin A[i]:=strtoint(edit1.Text); B[i]:=strtoint(edit2.Text); C[i]:=strtoint(edit3.Text); x[i]:=-1/2*A[i]; y[i]:=-1/2*B[i]; r:= sqrt((x[i]*x[i])+(y[i]*y[i])-C[i]);

listbox1.Items.Add('Pusat Lingkaran = ( '+floattostr(x[i])+','+floattostr(y[i])+')'); listbox1.Items.Add('Jari-jari lingkaran = '+floattostr(r)); listbox1.Items.Add('_____________________ ___________________________________ ___'); end; if i<100 then begin i:=i+1; end else if i=100 then messagedlg('STOP Data Bilangan Sudah 100 buah',mtInformation,[mbYes],0); edit1.text:=''; edit2.text:=''; edit3.text:=''; edit1.SetFocus; end;

procedure TForm5.BitBtn2Click(Sender: TObject); begin listbox1.Clear; edit1.clear; edit2.clear; edit3.clear; end; procedure TForm5.BitBtn3Click(Sender: TObject); begin close; end; procedure TForm5.Timer1Timer(Sender: TObject); begin label1.Left := label1.Left - 5; if label1.Left <= -100 then label1.Left := 550; end; end.

Tampilan Sebelum di Run

Lingkaran yang Berpusat di Titik (0,0)
Tampilan Setelah di Run

Listing Program
var Form6: TForm6; i:integer; r:array[0..10]of real; t:array[0..10]of real; iimplementation {$R *.dfm} procedure TForm6.BitBtn1Click(Sender: TObject); begin t[i]:=strtoint(edit2.Text); r[i]:=t[i]*t[i]; listbox1.Items.Add('jadi persamaan lingkarannya adalah X^2+Y^2='+floattostr(r[i])); listbox1.Items.Add('__________________ __________________________________ _______'); edit2.text:=''; edit2.SetFocus; end; listbox1.Items.Add('Jari-jari lingkaran = '+floattostr(t[i]));

procedure TForm6.BitBtn2Click(Sender: TObject); begin edit2.SetFocus; edit2.Clear; listbox1.Clear; end; procedure TForm6.BitBtn3Click(Sender: TObject); begin close; End; procedure TForm6.Timer1Timer(Sender: TObject); begin label1.Left := label1.Left - 5; if label1.Left <= -100 then label1.Left := 550; end; end.

Lingkaran yang Berpusat di Titik (h,k) h,k)
Tampilan Sebelum di Run Tampilan Setelah di Run

Listing Program
var Form7: TForm7; i:integer; h:array[0..100]of integer; k:array[0..100]of integer; r:array[0..100]of real; A:array[0..100]of real; B:array[0..100]of real; C:array[0..100]of real; implementation {$R *.dfm} procedure TForm7.BitBtn1Click(Sender: TObject); begin h[i]:=strtoint(edit1.Text); k[i]:=strtoint(edit2.Text); r[i]:=strtoint(edit3.Text); A[i]:=-2*h[i]; B[i]:=-2*k[i]; C[i]:= (h[i]*h[i])+(k[i]*k[i])-(r[i]*r[i]); listbox1.Items.add('pusat lingkaran ('+form7.edit1.text+','+form7.Edit2.text+')'); listbox1.Items.Add('jari-jari lingkaran(r) = '+form7.Edit3.text); listbox1.Items.Add('Jadi Persamaan lingkarannya adalah x^2+y^2+('+floattostr(A[i])+')x+('+floattostr(B[i]) +')y+('+floattostr(C[i])+')'); listbox1.Items.Add('_________________________ _______________________________________ _____________'); edit1.text:=''; edit2.text:='';

edit3.text:=''; edit1.SetFocus; end; procedure TForm7.BitBtn2Click(Sender: TObject); begin edit1.setfocus; edit1.clear; listbox1.Clear; end; procedure TForm7.BitBtn3Click(Sender: TObject); begin close; end; procedure TForm7.Timer1Timer(Sender: TObject); begin label1.Left := label1.Left - 5; if label1.Left <= -100 then label1.Left := 550; end; end.