[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.5

How to I model an array function to fit my script?

Asked by seeminglylost in Business Objects, .NET, Microsoft Visual Basic.Net

Tags: VB.net using Visual Studio 2005

I am in the process of using a two-dimensional array to find wind chill factors.  My application uses a nudTemp for temperature and nudWind for Wind Velocity.  When temp and wind are chosen from the nud list, it is supposed to display the wind chill temp in a text box and then display a message box.  Right now it does everything it is supposed to do except that it does not display the proper wind chill factor.

I know it is an issue with my arrays so I was provided with an example but I don't know where it goes in my script or how to modify it so that it matches my code.

The example I was provided is:
[code]
      Private arr1 As Integer() = New Integer() {10, 20, 30}
      Private arr2 As Integer() = New Integer() {100, 200, 300}
      Private arr3 As Integer(,) = New Integer(,) {{1000, 2000, 3000}, {2000, 4000, 6000}, {3000, 6000, 9000}}
      Private Function GetVal3(ByVal val1 As Integer, ByVal val2 As Integer) As Integer
          Dim index1 As Integer = Array.Index(arr1, val1)
          Dim index2 As Integer = Array.Index(arr2, val2)
 
          If index1 <> -1 AndAlso index2 <> -1 Then
              Return arr3(index1, index2)
          End If
      End Function
[/code]

I am new to VB.net and we are on our second day of arrays so I am a little lost.  Any assistance would be greatly appreciated.

I have provided my code listed below.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
Option Strict On
Public Class frmWindChill
 
    Dim intWindChill(7, 5) As Integer
    Dim intWind(5) As Integer
    Dim intTemp(7) As Integer
 
 
    Private Sub nudTemp_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudTemp.ValueChanged
 
        intTemp(0) = -20
        intTemp(1) = -15
        intTemp(2) = -10
        intTemp(3) = -5
        intTemp(4) = 0
        intTemp(5) = 5
        intTemp(6) = 10
        intTemp(7) = 15
 
    End Sub
 
    Private Sub frmWindChill_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
    End Sub
 
    Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
 
        txtWindChill.Text = CStr(intWindChill(7, 5))
        MessageBox.Show("The WindChill Factor is:" & intWindChill(7, 5).ToString)
 
 
    End Sub
 
    Private Sub nudWind_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudWind.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 btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
        txtWindChill.Text = ""
    End Sub
End Class
[+][-]10/26/09 09:37 PM, ID: 25669174Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/26/09 09:54 PM, ID: 25669230Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Business Objects, .NET, Microsoft Visual Basic.Net
Tags: VB.net using Visual Studio 2005
Sign Up Now!
Solution Provided By: roma2208
Participating Experts: 3
Solution Grade: A
 
[+][-]10/27/09 03:52 AM, ID: 25670866Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/27/09 03:57 AM, ID: 25670898Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 03:59 AM, ID: 25670906Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 04:09 AM, ID: 25670959Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/27/09 04:11 AM, ID: 25670971Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/27/09 04:12 AM, ID: 25670980Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 04:17 AM, ID: 25671004Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/27/09 04:21 AM, ID: 25671034Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 06:04 AM, ID: 25671903Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 06:11 AM, ID: 25671974Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 06:13 AM, ID: 25671989Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 06:29 AM, ID: 25672145Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 06:32 AM, ID: 25672165Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 06:42 AM, ID: 25672276Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625