Java Read File/Scanner
<p>I am a beginner at java, and I am struggling to get this code to work. I am trying to read in a CSV file, and then use that data to calculate the averages, and then return a summary of the highest lowest and average of the averages. </p>

<p>The input looks like this:</p>

<blockquote>
  <p>Alicia Marks,89,90,100,95,75,85,94,100,90,92</p>
  
  <p>Bobby Ricks,98,79,87,79,9,98,7,19,98,78</p>
</blockquote>

<p>Here's what the out put should look like (Numbers are not correct, example only):</p>

<blockquote>
  <p>Alicia Marks 85.5 B</p>
  
  <p>Bobby Ricks 90.0 A-</p>
  
  <p>...</p>
  
  <p>High 98.2</p>
  
  <p>Low 56.5</p>
  
  <p>Average 78.3333</p>
</blockquote>

<pre><code>import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

public class Test
{

    public static void main(String[] args)
    {
        Test x = new Test();
        x.high();
    }

    public void high()
    {
        File file2 = new File("scores.csv");
        try
        {
            Scanner scanner = new Scanner(file2);
            while (scanner.hasNextLine())
            {
                String line2 = scanner.nextLine();
                String[] value2 = line2.split(",");

                // Converts String Array into Double Array
                double[] score = new double[value2.length];
                for (int i = 1; i &lt; value2.length; i++)
                {
                    score[i] = Double.parseDouble(value2[i]);
                }

                // Finds the sum and then the average, adds it to a array List
                ArrayList&lt;Double&gt; av;
                av = new ArrayList&lt;Double&gt;();
                double sumNum = 0.0;
                for (double i : score)
                {
                    sumNum += i;
                }
                double aver = sumNum / 10;
                av.add(aver);

                double max = 0, min = 100;
                for (int a = 0; a &lt; av.size(); a++)
                {
                    double s = av.get(a);
                    max = Math.max(max, s);
                    min = Math.min(min, s);
                    aver += s;
                }

                System.out.println("High " + max + "");
                System.out.println("Low " + min + "");
                System.out.println("Average " + aver / av.size() + "");

            }
            scanner.close();
        }
        catch (FileNotFoundException e)
        {
            e.printStackTrace();
        }
    }
}
</code></pre>

<p>I think the problem I am having is with the while loop, but I am not too sure. Any help in fixing this would be really appreciated.</p>
