Hi, I having to find the wind chill using a two- dimensional array. I have to put the wind velocity in a numeric up down along with temperature. The temperature is from -20 to 15 in increments of 5 and wind velocity is 5 to 30 in increments of 5. It says use a function procedure to find the result and then return the result to the calling event procedure. I am having a lot of trouble with this if anybody can help. I'll show you my code and you can tell me how far off I am and offer some advice please.
CODE
Private intWindChill(7, 5) As Integer
Dim intwind(5) As Integer
Dim intTemperature(8) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub nudTemp_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudTemp.ValueChanged
intTemperature(0) = -20
intTemperature(1) = -15
intTemperature(2) = -10
intTemperature(3) = -5
intTemperature(4) = 0
intTemperature(5) = 5
intTemperature(6) = 10
intTemperature(7) = 15
End Sub
Private Sub nudVelocity_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudVelocity.ValueChanged
intwind(0) = 5
intwind(1) = 10
intwind(2) = 15
intwind(3) = 20
intwind(4) = 25
intwind(5) = 30
End Sub
Private Sub txtWindChill_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtWindChill.TextChanged
intWindChill(0, 0) = -26
intWindChill(0, 1) = -46
intWindChill(0, 2) = -58
intWindChill(0, 3) = -67
intWindChill(0, 4) = -74
intWindChill(0, 5) = -79
intWindChill(1, 0) = -21
intWindChill(1, 1) = -40
intWindChill(1, 2) = -51
intWindChill(1, 3) = -60
intWindChill(1, 4) = -66
intWindChill(1, 5) = -71
intWindChill(2, 0) = -15
intWindChill(2, 1) = -34
intWindChill(2, 2) = -45
intWindChill(2, 3) = -53
intWindChill(2, 4) = -59
intWindChill(2, 5) = -64
intWindChill(3, 0) = -10
intWindChill(3, 1) = -27
intWindChill(3, 2) = -38
intWindChill(3, 3) = -46
intWindChill(3, 4) = -51
intWindChill(3, 5) = -56
intWindChill(4, 0) = -5
intWindChill(4, 1) = -22
intWindChill(4, 2) = -31
intWindChill(4, 3) = -39
intWindChill(4, 4) = -44
intWindChill(4, 5) = -49
intWindChill(5, 0) = 0
intWindChill(5, 1) = -15
intWindChill(5, 2) = -25
intWindChill(5, 3) = -31
intWindChill(5, 4) = -36
intWindChill(5, 5) = -41
intWindChill(6, 0) = 7
intWindChill(6, 1) = -9
intWindChill(6, 2) = -18
intWindChill(6, 3) = -24
intWindChill(6, 4) = -29
intWindChill(6, 5) = -33
intWindChill(7, 0) = 12
intWindChill(7, 1) = -3
intWindChill(7, 2) = -11
intWindChill(7, 3) = -17
intWindChill(7, 4) = -22
intWindChill(7, 5) = -25
End Sub
Private Sub btnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFind.Click
txtWindChill.Text = intWindChill(7, 5)
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
End Class
This post has been edited by cardswin12: 12 May, 2008 - 06:16 AM