VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Measure if you (Men) are overweight or underweight

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

Rate 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



Download this snippet    Add to My Saved Code

Measure if you (Men) are overweight or underweight Comments

No comments have been posted about Measure if you (Men) are overweight or underweight. Why not be the first to post a comment about Measure if you (Men) are overweight or underweight.

Post your comment

Subject:
Message:
0/1000 characters