Professional Documents
Culture Documents
BMI Calculater For A Class
BMI Calculater For A Class
ListBox1.Items.Add("==============================================
=============")
End Sub
Dim I As Integer
For I = 1 To 5
txtName.Text = InputBox("Enter std Name")
txtHeight.Text = InputBox("Enter your Height")
txtWeight.Text = InputBox("Enter your weight")
H = Val(txtHeight.Text)
W = Val(txtWeight.Text)
TotalHeight = TotalHeight + H
TotalWeight = TotalWeight + W
BMI = (W / (H * H))
txtBMI.Text = Str(BMI)
If (BMI <= 18.5) Then
Status=Underweight
'MsgBox("You are unedrwaeight")
ElseIf (BMI <= 24.9) Then
Status=Normal weight
' MsgBox("You are Normal weight")
ElseIf (BMI <= 29.9) Then
Status=Overweight
' MsgBox("yOU ARE OVER WEIGHT")
Else
Status=oBESS
'MsgBox("yOU ARE OBESS")
End If
ListBox1.Items.Add(txtName.Text & vbTab & txtHeight.Text & vbTab & txtWeight.Text &
vbTab & txtBMI.Text& vbtab & status)
Next
AverageHeight = TotalHeight / 5
AverageWeight = TotalWeight / 5
AverageBMI = (AverageWeight / (AverageHeight * AverageHeight))
Label5.Text = Str(AverageHeight)
Label6.Text = Str(AverageWeight)
Label7.Text = Str(AverageBMI)
If (BMI <= 18.5) Then
Label8.Text = "This class is under weight"
'MsgBox("You are unedrwaeight")
ElseIf (BMI <= 24.9) Then
Label8.Text = "This class is Normal weight"
' MsgBox("You are Normal weight")
ElseIf (BMI <= 29.9) Then
Label8.Text = "This class is over weight"
' MsgBox("yOU ARE OVER WEIGHT")
Else
Label8.Text = "This class is Obess"
'MsgBox("yOU ARE OBESS")
End If
End Sub
End Sub
Private Sub Label9_Click(sender As System.Object, e As System.EventArgs) Handles
Label9.Click
End Sub
End Class