Private Sub Form_Load()
Dim tall, weight, BMI, minBMI As Single
Dim i As Integer
minBMI = 1000
Open "e:\vbtest\940304.sm" For Input As #1
For i = 1 To 3
Input #1, tall, weight
Print tall, weight,
tall = tall / 100 '變公尺
BMI = weight / (tall * tall)
'Print BMI,
BMI = (BMI * 10 + 5) \ 10
Print BMI
If minBMI > BMI Then minBMI = BMI
Next i
If minBMI >= 20 And minBMI <= 25 Then
Print "第四題結果:最小BMI 值="; minBMI; ",正常"
Else
Print "第四題結果:最小BMI 值="; minBMI; ",不正常"
End If
Close #1
End Sub
2008年4月19日 星期六
BMI計算
基本架構練習:
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言