FB

Delphi Membuat Kalkulator Sederhana

Wednesday, March 10, 2010





Kalkulator Sederhana yang pernah Saya Buat
Ni Listingnya:


var
Form1: TForm1;
a,b,z:double;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
a:=StrToFloat(txtVal1.Text);
b:=StrToFloat(txtVal2.Text);
z:=a+b;

ShowMessage(FloatToStr(z));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
a:=StrToFloat(txtVal1.Text);
b:=StrToFloat(txtVal2.Text);
z:=a-b;

ShowMessage(FloatToStr(z));
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
a:=StrToFloat(txtVal1.Text);
b:=StrToFloat(txtVal2.Text);
z:=a*b;

ShowMessage(FloatToStr(z));
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
a:=StrToFloat(txtVal1.Text);
b:=StrToFloat(txtVal2.Text);
z:=a/b;

ShowMessage(FloatToStr(z));
end;

end.

0 comments: