BLOGGER TEMPLATES AND TWITTER BACKGROUNDS

Selasa, 02 April 2013

BERMAIN-MAIN DENGAN PERCABANGAN DELPHI


procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,d : real;
begin
if edit1.Text>edit2.Text then
  begin
    a:=strtofloat(edit1.text);
    b:=strtofloat(edit2.text);
    c:=strtofloat(edit3.text);
    d:=(a-b)*c;
    edit4.Text:=floattostr(d);
    label1.Caption:='-';
  end
else
if edit1.Text  begin
    a:=strtofloat(edit1.text);
    b:=strtofloat(edit2.text);
    c:=strtofloat(edit3.text);
    d:=(a+b)*c;
    edit4.Text:=floattostr(d);
    label1.Caption:='+';
  end
end;

end.

0 komentar: