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
That means the all the fonts slide off the left side of the screen ... so tilt the monitor to the right. Does that help?
That is probaly as helpful as saying yo that1 is not working? What does that mean? IS there an error when the process runs? Are the results different then what you expected? We can't read the program on you screen you need to give detials.
@Gary : i got the unexpected result ... it keeps determine one only at the if selection .. don't know whether is about the calculation or the if statement.
could you fix it for me..
by your own coding and with reference i gave already.. i need to know what i already done / mistake.
@.paul. : the output still get the unexpected Result. ? although it fix a lil but in the End after entering both value , it still place it as Underweight as i said in the previous and now i put up weight 170 and height 172 , it become under weight underweight.. it suppose to be obese or overweight.
@.paul. : not working man.. are you sure.. it just fix the function like underweight ,and Obese.. the rest still doesn't fix..
@computerman : ya, i prefer the formula i use it first 1.. taken from health website.
==
i still dont know wheres my mistake on making it. this has prolong too much ... but yet it still bring me problem on making the real function of this Pucking code.. including other guys help me on it still have the same problem..