by Asif Kabir (1 Submission)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 14th June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Measure if you (Men) are overweight or underweight
Private Sub Command1_Click()
Dim Height As Single
Dim Weight As Single
Dim Name As String
Name = txtName.Text
Height = CSng(txtHeight.Text) / 100
Weight = CSng(txtweight.Text)
Dim Result As Single
Result = Weight / (Height * Height)
Result = Format(Result, "###.##")
If (Result < 20) Then
MsgBox Name & " , you are underweight "
ElseIf (Result > 20 And Result < 25) Then
MsgBox Name & ", your weight is normal "
ElseIf (Result > 25 And Result < 30) Then
MsgBox Name & " , you are overweight "
ElseIf (Result > 30) Then
MsgBox Name & " , you are much overweight"
End If
End Sub