2007-11-29 09:56:04,,飛ㄦ*

BMI的計算

Module Module1

Sub Main()
Dim A, B As Single
Console.Write(”請輸入身高:”)
A = Console.ReadLine
Console.Write(”請輸入體重:”)
B = Console.ReadLine
Console.Write(”您的BMI值為:” & bmi(A, B))
PAUSE()
End Sub
Function bmi(ByVal A As Single, ByVal B As Single) As Double
Dim COMPUTATION As Double
COMPUTATION = B / (A * A)
Return COMPUTATION
End Function
Sub PAUSE()
Console.WriteLine()
Console.WriteLine()
Console.Write(”>>>>>>>>>>程式暫停中<<<<<<<<<<”)
Console.ReadKey()
End Sub
End Module

上一篇:分數的計算

下一篇:圓面積的計算