Einzelnen Beitrag anzeigen

Thanatos81
(Gast)

n/a Beiträge
 
#9

Re: Geometrische Körper ausrechnen

  Alt 4. Jul 2005, 17:41
Du hast auch immernoch das PI drin. das muss weg. Sonst nimmt er nicht das "Delphi-Pi". Also so:

Delphi-Quellcode:
procedure TForm1.Button3Click(Sender: TObject);
var r, h, v, o, s: Real;
begin
  r :=strtofloat(Edit11.Text);
  h :=strtofloat(Edit12.Text);
  v :=((1/3)*(PI)*r*r*h);
  s :=(sqrt(h*h)+(r*r));
  o :=PI*r*(r + s);
  Edit13.Text :=floattostr(v);
  Edit14.Text :=floattostr(o);
end;
  Mit Zitat antworten Zitat