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:
Public Class Form1 Private Sub BtnResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnResult.Click Dim Weight As Integer = 0I Dim Height As Integer = 0I If Integer.TryParse(TxtWeight.Text, Weight) AndAlso Integer.TryParse(TxtHeight.Text, Height) Then 'Perform the calculations here. Weight = Weight * 703 Height = Height * Height Dim BMI As Integer = (Weight / Height) 'Do the check. If BMI < 0 Then LblShow.Text = "Error" ElseIf BMI <= 18.5 Then LblShow.Text = "Underweight" ElseIf BMI <= 24.9 Then LblShow.Text = "Normal" ElseIf BMI <= 29.9 Then LblShow.Text = "Overweight" Else LblShow.Text = "Obese" End If End If End Sub Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click TxtHeight.Clear() TxtWeight.Clear() LblShow.Text = " " End Sub Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click MessageBox.Show("Bye!!") Me.Close() End Sub End Class
http://www.freeimagehosting.net/uplo...bc94fc34aa.jpg




Reply With Quote