title: incorrect array calculations in the second loop
body: <p>When I do the calculations in the second for loop it does not calculate properly.
  I will only calculate the last number in the array and not the other two.
  The if block calculation are correct. What I need to do then is to take each 
  [row][col] value and divide that by temp3 and display it in the array.
  Please advice.
  Thank you in advance.
  Avi</p>
  
  <pre><code>package tester;
  
  import java.io.FileNotFoundException;
  import java.io.FileReader;
  import java.util.Scanner;
  
  public class Test1 {
  
  public static void main(String[] args) throws FileNotFoundException 
  {      
      Scanner inFile = new Scanner(new FileReader("one.txt"));
  
      float [][] glassdata = new float[3][4];
  
      loadArray(glassdata, inFile);
      displayArray(glassdata);
  
      System.out.println("\n***************\n");
  
      normalizingVector(glassdata);
  }
  
  public static void loadArray(float [][] g, Scanner inFile)
  {
      for(int row = 0; row &lt; g.length; row++)
      {
          for(int col = 0; col &lt; g[row].length; col++)
          {
             g[row][col] = inFile.nextFloat();
          }
      }      
  }
  
  public static void displayArray(float [][] g)   
  {
      for(int row = 0; row &lt; g.length; row++)
      {
          for(int col = 1; col &lt; g[row].length; col++)
          {
              System.out.print(g[row][col] + " ");
          }
          System.out.println();
      }
  }
  
  public static void normalizingVector(float [][] g)
  {
      float temp1 = 0;
      float temp2 = 0;
      float temp3 = 0;
      float temp4 = 0;
  
  
      for (int row = 0; row &lt; g.length; row++)
      {
          for(int col = 1; col &lt; g[row].length; col++)
          {
              if(col &lt; g[row].length)
              {
                  temp1 = (float) Math.pow(g[row][col], 2);               
                  temp2 = temp2 + temp1;
              }
              temp3 = (float) Math.sqrt(temp2);
              temp4 = (g[row][col]) / temp3;
              //System.out.print((g[row][col] / temp3) + " ");
              System.out.print(temp4 + " ");
          }
          //System.out.print(temp3);
          System.out.println();
          temp1 = 0;
          temp2 = 0;
          temp3 = 0;
          temp4 = 0;
  
      }
  }
  }
  </code></pre>