Solver Surface area and Volume of a cylinder
Algebra
->
Angles
-> Solver Surface area and Volume of a cylinder
Log On
Geometry: Angles, complementary, supplementary angles
Geometry
Solvers
Solvers
Lessons
Lessons
Answers archive
Answers
Source code of 'Surface area and Volume of a cylinder'
This Solver (Surface area and Volume of a cylinder)
was created by by
hummingbird(0)
:
View Source
,
Show
,
Put on YOUR site
About hummingbird
:
==section input Input the following parameters of the cylinder: Height H = *[input h=1] and Radius R = *[input r=1] ==section solution perl if($r<=0 || $h<=0){ print" Please enter the positive values ( >0 ) of parameter!!!"; } else{ my $sa = 2*3.14159265*$r*$h; my $sa2 = $sa+ 2*3.14159265*$r*$r; my $v = 3.14159265*$r*$r*$h; print "The surface area (SA) of a cylinder, excluding the base area and top area, is given by {{{SA = 2*pi*R*H}}} When the areas of base and top are included, the surface area becomes {{{SA = 2*pi*R*H + 2*pi*R^2}}} {{{SA = 2*pi*R*(R+H)}}} The volume of the cone can be found by the formula {{{V = pi*R^2*H}}} In our case the desired values are thus: SA (without base and top) = {{{2*pi*$r*$h = $sa}}} SA (with base and top) = {{{2*pi*$r*$h + 2*pi*$r^2 = $sa2}}} V = {{{pi*$r^2*$h = $v}}} For more on this topic, refer to <A HREF=Surface_area.wikipedia>Surface area</A> and <A HREF=Volume.wikipedia>Volume</A>. "; } ==section output sa, v, ==section check h=3 r=4 sa=75.39816 v=150.7964472