Hey,
I've just written this code, unfortunately the 'price' & 'price2' variables always returns as 0 when I print it, and I'm really confused why as it should, also instead of it adding the value to price during the if statements, it just goes straight to the last Else which prints out that I should enter a correct numeric value
Dim theHeight As String = heightEntry.Text
Dim theWidth As String = widthEntry.Text
Dim price As Integer
Dim price2 As Integer
If IsNumeric(theWidth) >= 1800 Then
price = 1444
ElseIf IsNumeric(theWidth) >= 1801 And IsNumeric(theWidth) <= 2000 Then
price = 1458
ElseIf IsNumeric(theWidth) >= 2001 And IsNumeric(theWidth) <= 2200 Then
price = 1479
ElseIf IsNumeric(theWidth) >= 2201 And IsNumeric(theWidth) <= 2400 Then
price = 1580
ElseIf IsNumeric(theWidth) >= 2401 And IsNumeric(theWidth) <= 2600 Then
price = 1606
ElseIf IsNumeric(theWidth) >= 2601 And IsNumeric(theWidth) <= 2800 Then
price = 1630
ElseIf IsNumeric(theWidth) >= 2801 And IsNumeric(theWidth) <= 3000 Then
price = 2185
ElseIf IsNumeric(theWidth) >= 3001 And IsNumeric(theWidth) <= 3200 Then
price = 2204
ElseIf IsNumeric(theWidth) >= 3201 And IsNumeric(theWidth) <= 3400 Then
price = 2259
Else
Output("Please Enter Numbers Between 1800 to 3400")
End If
If IsNumeric(theHeight) > 2100 Then
price2 = price * 1.05
Else
price2 = price
End If
Output("Value is: " + price2.ToString)
End Sub
Any help would be greatly appreciated, thanks!