Sie sind auf Seite 1von 41

var

Form1: TForm1; implementation uses U_Faktorial1, U_InputData, U_Kalkulator,U_PersamaanKuadrat, U_Exit, U_DeretGeometri, U_DeretAritmatika, U_VolumeLuasKubus, U_VolumeLuasBalok; {$R *.dfm} procedure TForm1.Aritmatika1Click(Sender: TObject); begin FormDeretAritmatika.Show; end;

procedure TForm1.Faktorial1Click(Sender: TObject); begin FormFaktorial.show; end; procedure TForm1.Geometri1Click(Sender: TObject); begin FormDeretGeometri.show; end; procedure TForm1.InputData1Click(Sender: TObject); begin form2.show; end; procedure TForm1.Kalkulator1Click(Sender: TObject); begin form3.show; end;

procedure TForm1.Kalkulator1Click(Sender: TObject); begin form3.show; end; procedure TForm1.limas1Click(Sender: TObject); begin form10.Show; end; procedure TForm1.PersamaanKuadrat1Click(Sender: TObject); begin form5.show; end; procedure TForm1.Prisma1Click(Sender: TObject); begin form11.show; end;

procedure TForm1.Timer1Timer(Sender: TObject); begin LABEL6.Caption:='PUKUL '+TIMETOSTR(NOW); LABEL7.Caption:='TANGGAL '+DATETOSTR(NOW); end; procedure TForm1.Timer2Timer(Sender: TObject); begin Label1.left := Label1.left -1; if Label1.left < -600 then Label1.left := 600; end; procedure TForm1.Timer3Timer(Sender: TObject); begin if label3.Visible=true then label3.Visible:=false else label3.Visible:=true; end;

procedure TForm1.Timer4Timer(Sender: TObject); begin if label4.Visible=true then label4.Visible:=false else label4.Visible:=true; end; procedure TForm1.Timer5Timer(Sender: TObject); begin if label5.Visible=true then label5.Visible:=false else label5.Visible:=true; end; procedure TForm1.Timer6Timer(Sender: TObject); begin if label8.Visible=true then label8.Visible:=false else label8.Visible:=true; end; end.

var Form2: TForm2; implementation {$R *.dfm} procedure TForm2.BitBtn1Click(Sender: TObject); var s:string; p,i:integer; No,Nama,Nim,JenisKelamin,Jurusan,NoTelp,Alamat,Statu s :array[1..30]of string;

begin No[i]:=inputbox('ID','No',''); Nama[i]:=inputbox('ID','Nama',''); Nim[i]:=inputbox('ID','Nim',''); JenisKelamin[i]:=inputbox('ID','Jenis Kelamin',''); Jurusan[i]:=inputbox('ID','Jurusan',''); NoTelp[i]:=inputbox('ID','No Telp',''); Alamat[i]:=inputbox('ID','Alamat',''); Status[i]:=inputbox('ID','Status',''); listbox1.Items.Add('No'+chr(1)+chr(1)+c hr(1)+chr(1)+chr(1)+' : '+inttostr(i)); listbox1.Items.Add('Nama'+chr(1)+chr(1) +chr(1)+chr(1)+' : '+nama[1]); listbox1.Items.Add('Nim'+chr(1)+chr(1)+ chr(1)+chr(1)+chr(1)+' : '+Nim[i]); listbox1.Items.Add('Jenis Kelamin'+chr(1)+' : '+JenisKelamin[i]);

listbox1.Items.Add('Jurusan'+chr(1)+chr(1)+chr(1)+' : '+Jurusan[i]); listbox1.Items.Add('No Telp'+chr(1)+chr(1)+chr(1)+' : '+NoTelp[i]); listbox1.Items.Add('Alamat'+chr(1)+chr(1)+chr(1)+chr(1)+': '+Alamat[i]); listbox1.Items.Add('Status'+chr(1)+chr(1)+chr(1)+chr(1)+' : '+Status[i]); 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]:=JenisKelamin[i]; stringgrid1.Cells[4,i]:=Jurusan[i]; stringgrid1.Cells[5,i]:=NoTelp[i]; stringgrid1.Cells[6,i]:=Alamat[i]; stringgrid1.Cells[7,i]:=Status[i]; listbox1.Visible:=true; end; end;

procedure TForm2.BitBtn3Click(Sender: TObject); begin listbox1.Clear; listbox1.Visible:=false; end; procedure TForm2.BitBtn4Click(Sender: TObject); begin close; end; procedure TForm2.Timer1Timer(Sender: TObject); begin if label4.Visible=true then label4.Visible:=false else label4.Visible:=true; end; end.

var

Form3: TForm3; var a,b:integer; c,d:real; implementation {$R *.dfm} procedure TForm3.BitBtn1Click(Sender: TObject); begin edit1.Clear; edit2.Clear; edit3.Clear; edit4.Clear; label5.caption:=''; end;

procedure TForm3.BitBtn2Click(Sender: TObject); begin close; end; procedure TForm3.SpeedButton1Click(Sender: TObject); begin a:=strtoint(edit1.Text); b:=strtoint(edit2.Text); d:=strtoint(edit3.Text); edit3.text:=floattostr(d); c:=a+b; edit4.text:=floattostr(c); if c=d then label5.Caption:=' Jawabanmu Benar ' else label5.Caption:=' Jawabanmu Salah '; end;

procedure TForm3.SpeedButton2Click(Sender: TObject); begin a:=strtoint(edit1.Text); b:=strtoint(edit2.Text); d:=strtoint(edit3.Text); edit3.text:=floattostr(d); c:=a*b; edit4.text:=floattostr(c); if c=d then label5.Caption:=' Jawabanmu Benar ' else label5.Caption:=' Jawabanmu Salah '; end;

procedure TForm3.SpeedButton3Click(Sender: TObject); begin a:=strtoint(edit1.Text); b:=strtoint(edit2.Text); d:=strtoint(edit3.Text); edit3.text:=floattostr(d); c:=a/b; edit4.text:=floattostr(c); if c=d then label5.Caption:=' Jawabanmu Benar ' else label5.Caption:=' Jawabanmu Salah '; end;

procedure TForm3.SpeedButton4Click(Sender: TObject); begin a:=strtoint(edit1.Text); b:=strtoint(edit2.Text); d:=strtoint(edit3.Text); edit3.text:=floattostr(d); c:=a-b; edit4.text:=floattostr(c); if c=d then label5.Caption:=' Jawabanmu Benar ' else label5.Caption:=' Jawabanmu Salah '; end;

procedure TForm3.SpeedButton5Click(Sender: TObject); begin a:=strtoint(edit1.Text); b:=strtoint(edit2.Text); d:=strtoint(edit3.Text); edit3.text:=floattostr(d); c:=exp(b*ln(a)); edit4.Text:=floattostr(c); if c=d then label5.Caption:=' Jawabanmu Benar ' else label5.Caption:=' Jawabanmu Salah '; end;

procedure TForm3.Timer1Timer(Sende r: TObject); begin Label5.left := Label5.left -1; if Label5.left <= -200 then Label5.left := 500; end; end.

var FormDeretAritmatika: TFormDeretAritmatika; i,n:integer; a,b,m,Un,Sn:real; implementation

procedure TFormDeretAritmatika.BitBtn1Click(Sender: TObject); begin close; end; procedure TFormDeretAritmatika.Button1Click(Sender: TObject); begin a:=strtofloat(edit1.Text); b:=strtofloat(edit2.Text); n:=strtoint(edit3.Text); Un:=a+(n-1)*b; Sn:=1/2*n*(a+Un); m:=-1;

Listbox1.Items.Add(' Tampilan Hasil Jumlah Deret Aritmetika '); for i:=1 to n do begin m:=m+b; listbox1.Items.add(' Nilai Suku Ke '+inttostr(i)+' atauU '+inttostr(i)+' = ' +floattostr(m)); end; Listbox1.Items.Add(' Nilai Suku Pertama atau a= '+floattostr(a)); Listbox1.Items.Add(' Nilai Beda Bilangan atau b= '+floattostr(b)); listbox1.Items.add(' Jumlah Deret Aritmetika '+inttostr(n)+' Suku Pertama= ' +floattostr(Sn)); listbox1.Visible:=true; end;

procedure TFormDeretAritmatika.Button2Cli ck(Sender: TObject); begin edit1.Clear; edit2.Clear; edit3.Clear; listbox1.Clear; listbox1.Visible:=false; end; end.

var FormDeretGeometri: TFormDeretGeometri; i,a,r,n:integer; P,Un,Sn:real; implementation {$R *.dfm}

procedure TFormDeretAritmatika.BitBtn1Click(Sender: TObject); begin close; end; procedure TFormDeretAritmatika.Button1Click(Sender: TObject); begin a:=strtofloat(edit1.Text); b:=strtofloat(edit2.Text); n:=strtoint(edit3.Text); Un:=a+(n-1)*b; Sn:=1/2*n*(a+Un); m:=-1;

Listbox1.Items.Add(' Tampilan Hasil Jumlah Deret Aritmetika '); for i:=1 to n do begin m:=m+b; listbox1.Items.add(' Nilai Suku Ke '+inttostr(i)+' atauU '+inttostr(i)+' = ' +floattostr(m)); end; Listbox1.Items.Add(' Nilai Suku Pertama atau a= '+floattostr(a)); Listbox1.Items.Add(' Nilai Beda Bilangan atau b= '+floattostr(b)); listbox1.Items.add(' Jumlah Deret Aritmetika '+inttostr(n)+' Suku Pertama= ' +floattostr(Sn)); listbox1.Visible:=true; end;

procedure TFormDeretAritmatika.Button2C lick(Sender: TObject); begin edit1.Clear; edit2.Clear; edit3.Clear; listbox1.Clear; listbox1.Visible:=false; end; end.

var Form5: TForm5; A,B,C,D,E,F,G:real; implementation {$R *.dfm}

procedure TForm5.BitBtn1Click(Sender: TObject); begin A:=strtofloat(edit1.Text); B:=strtofloat(edit2.Text); C:=strtofloat(edit3.Text); D:=B*B-4*A*C; edit4.Text:=floattostr(D); if D=0 then begin E:=-B/(2*A); F:=-B/(2*A); edit5.Text:=floattostr(E); edit6.Text:=floattostr(F); Label10.Caption:=' Ada Dua Akar yang Sama '; G:=(E*E)+(F*F); edit7.Text:=floattostr(G); end

else if D>0 then begin E:=(-B + Sqrt(D))/(2*A); F:=(-B - Sqrt(D))/(2*A); edit5.Text:=floattostr(E); edit6.Text:=floattostr(F); Label10.Caption:=' Ada Dua Akar Real Berlainan '; G:=(E*E)+(F*F); edit7.Text:=floattostr(G); end else if D<0 then begin E:=-B/(2*A); F:=Sqrt(-D)/(2*A); edit5.Text:=floattostr(E); edit6.Text:=floattostr(F); Label10.Caption:=' Ada Dua Akar Imaginair Berlainan '; G:=(E*E)+(F*F); edit7.Text:=floattostr(G); end; label10.Visible:=true; end;

procedure TForm5.BitBtn3Click(Sender: TObject); begin close; end; procedure TForm5.Button1Click(Sender: TObject); begin edit1.Clear; edit2.Clear; edit3.Clear; edit4.Clear; edit5.Clear; edit6.Clear; edit7.Clear; label10.caption:=''; end; procedure TForm5.Timer1Timer(Sender: TObject); begin Label10.left := Label10.left -1; if Label10.left <= -200then Label10.left := 358; end; end.

var Form11: TForm11; s:string; j,i,a,b,c:integer; V,Lp:real; p:array[1..10]of string; l:array[1..10]of string; t:array[1..10]of string; implementation {$R *.dfm}

procedure TForm11.BitBtn1Click(Sender: TObject); begin listbox1.Items.Clear; s:=inputbox('Loop','Jumlah Input Data',''); j:=strtoint(s); for i := 1 to j do begin p[i]:=inputbox('ID','Tentukan Panjang',''); l[i]:=inputbox('ID','Tentukan Lebar',''); t[i]:=inputbox('ID','Tentukan Tinggi',''); a:=strtoint(p[i]); b:=strtoint(l[i]); c:=strtoint(t[i]); V:=a*b*c; listbox1.Items.Add('Jadi Volumenya Adalah '+' = '+inttostr(a)+' X '+inttostr(b)+' X '+inttostr(c)+' = '+floattostr(v)); image1.visible:=true; Lp:=2*(a*b+a*c+b*c); listbox1.Items.Add('Jadi Luas Permukaanya Adalah ='+'2('+inttostr(a)+'x'+inttostr(b)+'+'+inttostr(a)+'x'+intto str(c)+'+'+inttostr(b)+'x'+inttostr(c)+')='+floattostr(v)); end; end;

procedure TForm11.BitBtn2Click(Sender: TObject); begin listbox1.Clear; image1.visible:=false; end; procedure TForm11.BitBtn3Click(Sender: TObject); begin close; end; end.

var Form10: TForm10; s:string; a,p,i:integer; Sisi :array[1..30]of string; V,L:real; implementation {$R *.dfm}

procedure TForm10.Button2Click(Sender: TObject); begin listbox1.Clear; image2.Visible:=false; listbox1.Visible:=false; end; procedure TForm10.Button3Click(Sender: TObject); begin close; end;

end.

var FormFaktorial: TFormFaktorial; a,b,i,j,fakt1,fakt2:integer; implementation {$R *.dfm}

procedure TFormFaktorial.BitBtn1Click(Sender: TObject); begin a:=strtoint(edit1.Text); fakt1:=1; for i:=2 to a do fakt1:=fakt1*i; edit3.Text:=inttostr(fakt1); b:=strtoint(edit2.Text); fakt2:=1; for j:=2 to a do fakt2:=fakt1*j; edit4.Text:=inttostr(fakt2); edit5.Text:=floattostr(strtoint(edit3. Text)*strtoint(edit4.Text)); end;

procedure TFormFaktorial.BitBtn2Click(Sender: TObject); begin edit1.Clear; edit2.Clear; edit3.Clear; edit4.Clear; edit5.Clear; end; procedure TFormFaktorial.BitBtn3Click(Sender: TObject); begin close; end; end.

var FormExit: TFormExit; implementation {$R *.dfm} procedure TFormExit.Button1Click(Sender: TObject); begin application.Terminate; end;

procedure TFormExit.Timer1Timer(Sender: TObject); begin Label1.top := Label1.top -1; if Label1.top <= -75 then Label1.top := 100; end; procedure TFormExit.Timer2Timer(Sender: TObject); begin Label2.left := Label2.left -1; if Label2.left <= -500 then Label2.left := 600; end;

procedure TFormExit.Timer3Timer(Sender: TObject); begin if button1.Visible=true then button1.Visible:=false else button1.Visible:=true; end; end.

Das könnte Ihnen auch gefallen