|
Area of various shapes
Several functions that show how to get the area
of various shapes
find the area of a square
<%
Function calcarea(dblLength)
calcarea = dblLength * dblLength
End Function
%>
and test the function with the following
<%
Response.Write calcarea(10) & "<br>"
Response.Write calcarea(5.87) & "<br>"
%>
find the area of a circle
<%
Const PI = 3.1416
Function CalcCircleArea(dblRadius)
CalcCircleArea = PI * (dblRadius ^ 2)
End Function
%>
now test the function with the following code
<%
Response.Write CalcCircleArea(4.5) & "<br>"
Response.Write CalcCircleArea(7) & "<br>"
%>
|