Sei sulla pagina 1di 1

Private Sub Command1_Click()

Label1.Caption = (Text1.Text) / (Text2.Text) ^ 2

Label1.Caption = Math.Round(Label1.Caption, 2)

If Label1.Caption <= 18.5 Then

Label2.Caption = "A BMI of less than 18.5 indicates that you are underweight, so you may need to put
on some weight. You are recommended to ask your Doctor or a dietician for advice."

ElseIf Label1.Caption <= 24.9 Then

Label2.Caption = "A BMI of 18.5 - 24.9 indicates that you are at a healthy weight for your height. By
maintaining a healthy weight, you lower your risk of developing serious health problems."

ElseIf Label1.Caption <= 29.9 Then

Label2.Caption = "A BMI of 25 - 30 indicates that you are overweight. You may be advised to lose some
weight for health reasons. You are recommended to talk to your Doctor or a dietician for advice."

ElseIf Label1.Caption >= 30 Then

Label2.Caption = "A BMI of over 30 indicates that you are heavily overweight. Your health may be at risk
if you do not lose weight. You are recommended to talk to your Doctor or a dietician for advice."

End If

End Sub

Potrebbero piacerti anche