Results 1 to 16 of 16

Thread: Re Post BMI Calculator Helps..

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2010
    Posts
    26

    Re Post BMI Calculator Helps..

    Actually this my 1st Coding then i actually change it to the new 1 but i found the value determine only turn to underweight only.
    so could anyone help me here for my school project.




    Bmi Calculator Code:
    1. Public Class Form1
    2.     Private Sub BtnResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnResult.Click
    3.  
    4.         Dim Weight As Integer = 0I
    5.         Dim Height As Integer = 0I
    6.         If Integer.TryParse(TxtWeight.Text, Weight) AndAlso Integer.TryParse(TxtHeight.Text, Height) Then
    7.  
    8.             'Perform the calculations here.
    9.  
    10.             Weight = Weight * 703
    11.             Height = Height * Height
    12.             Dim BMI As Integer = (Weight / Height)
    13.  
    14.             'Do the check.
    15.             If BMI < 0 Then
    16.                 LblShow.Text = "Error"
    17.             ElseIf BMI <= 18.5 Then
    18.                 LblShow.Text = "Underweight"
    19.             ElseIf BMI <= 24.9 Then
    20.                 LblShow.Text = "Normal"
    21.             ElseIf BMI <= 29.9 Then
    22.                 LblShow.Text = "Overweight"
    23.             Else
    24.                 LblShow.Text = "Obese"
    25.  
    26.             End If
    27.  
    28.  
    29.         End If
    30.  
    31.     End Sub
    32.     Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click
    33.  
    34.         TxtHeight.Clear()
    35.  
    36.         TxtWeight.Clear()
    37.  
    38.         LblShow.Text = " "
    39.  
    40.     End Sub
    41.     Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click
    42.  
    43.         MessageBox.Show("Bye!!")
    44.  
    45.         Me.Close()
    46.  
    47.     End Sub
    48.  
    49. End Class

    http://www.freeimagehosting.net/uplo...bc94fc34aa.jpg
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width