nochangeforyou
New member
- Joined
- Sep 4, 2013
- Messages
- 3
- Programming Experience
- Beginner
So I am working on a set of assignments for my class and I am stuck on one I created for temperature conversion. You must have two functions in the program and I am sure that is where my problems lie. It is not giving any errors, just when you click the buttons to calculate it always comes back with 0.00. Any help nudging me in the right direction would be helpful, I have little experience with programming.
Public Class TemperatureConversionForm
Private Sub convertFahrenheitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertFahrenheitButton.Click
Dim Celsius As Double
outputLabel.Text = String.Format("{0:F}", Celsius)
End Sub
Private Function FahrenheitToCelsius(ByVal Fahrenheit As Double) As Double
'convert fahrenheit to Celsius
Dim Celsius As Double = Val(degreeTextBox.Text)
Celsius = (5 / 9) * (fahrenheit - 32)
Return Celsius
End Function
Private Sub convertCelsiusButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertCelsiusButton.Click
Dim Fahrenheit As Double
End Sub
Private Function CelsiustoFahrenheit(ByVal Celsius As Double) As Double
'convert fahrenheit to Celsius
Dim Fahrenheit As Double = Val(degreeTextBox.Text)
Fahrenheit = (9 / 5) * Celsius + 32
Return Celsius
End Function
End Class ' TemperatureConversionForm
Public Class TemperatureConversionForm
Private Sub convertFahrenheitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertFahrenheitButton.Click
Dim Celsius As Double
outputLabel.Text = String.Format("{0:F}", Celsius)
End Sub
Private Function FahrenheitToCelsius(ByVal Fahrenheit As Double) As Double
'convert fahrenheit to Celsius
Dim Celsius As Double = Val(degreeTextBox.Text)
Celsius = (5 / 9) * (fahrenheit - 32)
Return Celsius
End Function
Private Sub convertCelsiusButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertCelsiusButton.Click
Dim Fahrenheit As Double
End Sub
Private Function CelsiustoFahrenheit(ByVal Celsius As Double) As Double
'convert fahrenheit to Celsius
Dim Fahrenheit As Double = Val(degreeTextBox.Text)
Fahrenheit = (9 / 5) * Celsius + 32
Return Celsius
End Function
End Class ' TemperatureConversionForm