RSS
Selamat di blog ini, semoga para pengunjung blog ini mendapat manfaat dari semua isi dari blog ini

My Love

DELPHI (PROGRAM LINGKARAN DAN LUAS SEGITIGA)

PROGRAM LINGKARAN




procedure TForm1.Button1Click(Sender: TObject);

var

r:integer;

k,l:real;

begin

r:=strtoint(edit1.Text);

k:=2*3.14*r;

l:=3.14*r*r;

edit2.Text:=floattostr(k);

edit3.Text:=floattostr(l);

end;


procedure TForm1.Button2Click(Sender: TObject);


begin

edit1.Text:='';

edit2.Text:='';

edit3.Text:='';

edit1.SetFocus;

end;


procedure TForm1.Button3Click(Sender: TObject);


begin

application.Terminate;

end;

end.



PROGRAM SEGITIGA




procedure TForm1.Button1Click(Sender: TObject);

var

a,t:integer;

l:real;

begin

a:=strtoint(edit1.Text);

t:=strtoint(edit2.Text);

l:=0.5*a*t;

edit3.Text:=floattostr(l);

end;


procedure TForm1.Button2Click(Sender: TObject);


begin

edit1.Text:='';

edit2.Text:='';

edit3.Text:='';

edit1.setfocus;

end;


procedure TForm1.Button3Click(Sender: TObject);


begin

application.terminate

end;

end.

0 komentar:

Posting Komentar