Turn on thread page Beta

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

    • Thread Starter
    Offline

    0
    ReputationRep:
    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
 
 
 
Poll
Do you think parents should charge rent?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.