title: java methods multiplying elements with in an array using a loop
body: <p>Deﬁne a Java method named weightedSum() that takes two integer arrays as its arguments. The 
  method uses a loop to multiply corresponding elements of the two arrays together (i.e., it multiplies the ﬁrst argument of each array together, followed by multiplying the second element of each array together, and so on) and returns the sum of those products (which is also an integer). You may assume that both arrays are of equal length.</p>
  
  <pre><code>public int weightedSum(int [] a ,int [] b)
  
  
      {
          int value;
          int sum ;
  
          for (int i = 0 ; i &lt; a.length ; i++)
          {
              value = a[i] * b [i];
              value  = value +value ;
  
          }
  
          return value;
  </code></pre>
  
  <p>I am having trouble writing this method out for my assignment . I under stand it accepts to arrays but i am having trouble writing out the loop itself so that it multiplies each individual element of the array with its counterpart in the opposite array so pos [1] * pos [1] and then add the two values togather with pos [2] + pos[2] and  to get the sum total for all the values </p>