You are on page 1of 6

unit bangunruangsekian;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm1 = class(TForm)

RadioButton1: TRadioButton;

RadioButton2: TRadioButton;

RadioButton3: TRadioButton;

RadioButton4: TRadioButton;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Edit1: TEdit;

Edit2: TEdit;

Edit3: TEdit;

Label4: TLabel;

Label5: TLabel;

Edit4: TEdit;

Edit5: TEdit;

Button1: TButton;
Label6: TLabel;

procedure RadioButton3Click(Sender: TObject);

procedure RadioButton1Click(Sender: TObject);

procedure RadioButton2Click(Sender: TObject);

procedure RadioButton4Click(Sender: TObject);

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

s,p,l,t,a,ta:integer;

lp,vol:real;

implementation

{$R *.dfm}

procedure TForm1.RadioButton3Click(Sender: TObject);

begin

label1.caption:='SISI ALAS';

label2.caption:='TINGGI ALAS';
label3.caption:='TINGGI';

end;

procedure TForm1.RadioButton1Click(Sender: TObject);

begin

label1.Caption:='SISI';

label2.caption:='SISI';

label3.caption:='SISI';

end;

procedure TForm1.RadioButton2Click(Sender: TObject);

begin

label1.caption:='PANJANG';

label2.caption:='LEBAR';

label3.caption:='TINGGI';

end;

procedure TForm1.RadioButton4Click(Sender: TObject);

begin

label1.caption:='TINGGI';

label2.caption:='TINGGI ALAS';

label3.caption:='SISI ALAS';

end;

procedure TForm1.Button1Click(Sender: TObject);


begin

begin

if radiobutton1.checked=true then

s:=strtoint(edit1.Text);

s:=strtoint(edit2.Text);

s:=strtoint(edit3.Text);

lp:=6*s*s;

vol:=s*s*s;

edit4.Text:=floattostr(lp);

edit5.text:=floattostr(vol);

if radiobutton2.Checked=true then

p:=strtoint(edit1.Text);

l:=strtoint(edit2.Text);

t:=strtoint(edit3.Text);

lp:=(2*p*t)+(2*p*l)+(2*l*t);

vol:=p*l*t;

edit4.Text:=floattostr(lp);

edit5.Text:=floattostr(vol);

if radiobutton3.Checked=true then

a:=strtoint(edit1.Text);

ta:=strtoint(edit2.Text);

t:=strtoint(edit3.Text);

lp:=(a*ta)+(a*t);
vol:=(1/2)*a*ta*t;

edit4.Text:=floattostr(lp);

edit5.Text:=floattostr(vol);

if radiobutton4.Checked=true then

t:=strtoint(edit1.Text);

ta:=strtoint(edit2.Text);

a:=strtoint(edit3.Text);

lp:=(1/2)*a*ta+(3*(1/2)*a*sqrt(sqr((1/3)*ta)+sqr(t)));

vol:=(1/3)*(1/2)*a*ta*t;

edit4.Text:=floattostr(lp);

edit5.Text:=floattostr(vol);

end;

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

label1.Caption:='';

label2.caption:='';

label3.caption:='';

edit1.Text:='';

edit2.Text:='';

edit3.Text:='';

edit4.Text:='';
edit5.Text:='';

end;

end.

You might also like