- Home >
- Delphi , fakti upy , Materi Kuliah , PBO >
- Menghitung Luas dan Volume Tabung - Delphi
Posted by : Efdi
Minggu, 01 Desember 2013
unit menghitung_luas_volume_tabung;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label5: TLabel;
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button1Click(Sender: TObject);
var T,R,L,V:real;
begin
//input
T:=strtofloat(edit1.text);
R:=strtofloat(edit2.text);
//proses
V:=0.25*3.14*2*r*t;
L:=2*3.14*R*(R+T);
//output
edit3.Text:=floattostr(V);
edit4.Text:=floattostr(L);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
end;
end.