The Student Room Group

Need help with a school assignment - its driving me nuts!

the task is to write a program that tells you when a particular substance is boiling or freezing... enter a temperature and click show result....

I've set up everything visually and for whatever reason... my input is not working with my if/else condition statement. i can substitute an actual number in place of the inputVariable and the code works as it should but once I change the number back to the variable name... it doesn't work right anymore. I'm using VB 2012.

(I've tried a few different ways so my code notation is kinda weird)

Private Sub btnEffects_Click(sender As Object, e As EventArgs) Handles btnEffects.Click

' Variables
Dim dblInput As Short

' display results of input
If dblInput <= 32 Then
lblWaterMsg.Text = "Freezing"
Else lblWaterMsg.Text = "No Effect"
End If
End Sub
(edited 8 years ago)

Quick Reply

Latest

Trending

Trending