Forum > Beginners

Calculating Volume and surface of the ball using Program

(1/2) > >>

godik:
Hello Can Someone help me how can I do this? and when i want to make this program i have to use Button,Tedit,Tlabel.Thank you all.

Blaazen:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses math;...volume:=4*pi*power(r, 3)/3;surface:=4*pi*r*r;

godik:
But I have to use button,tedit and tlabel

Blaazen:
I guess user will fill the radius of the ball to the edit. You have to convert it from string to integer with r:=strtoint(Edit1.Text);

You can do it in event Button1.OnClick, together with the formulas above. And result write to the label, using Label1.Caption:=inttostr(Volume);

Just try yourself or show us what you already have.

Handoko:
@godik

It sounds like a homework.

Have you wrote something? Show us your code. If none, you should try to do it your best first then post your code here, so others can guide you.

Navigation

[0] Message Index

[#] Next page

Go to full version