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