How to implement array processing with read file data?
<p>I'm trying to figure out how to read data from a file, using an array. The data in the file is listed like this:</p>

<pre><code>Clarkson 80000
Seacrest 100000
Dunkleman 75000
...
</code></pre>

<p>I want to store that information using an array. Currently I have something like this to read the data and use it:</p>

<pre><code>            String name1 = in1.next();
            int vote1 = in1.nextInt();


            //System.out.println(name1 +" " + vote1);

            String name2 = in1.next();
            int vote2 = in1.nextInt();

            //System.out.println(name2 +" " + vote2);

            String name3 = in1.next();
            int vote3 = in1.nextInt();
              ...
              //for all names
</code></pre>

<p>Problem is, the way I'm doing it means I can never manipulate the file data for more contestants or whatnot.
While I can use this way and handle all the math within different methods and get the expected output...its really inefficient I think.</p>

<p>Output expected:</p>

<pre><code>American Idol Fake Results for 2099
Idol Name        Votes Received    % of Total Votes
__________________________________________________      
Clarkson            80,000            14.4%
Seacrest            100,000           18.0%
Dunkleman           75,000            13.5%
Cowell              110,000           19.7%
Abdul               125,000           22.4%
Jackson             67,000            12.0%

Total Votes         557,000

The winner is Abdul!
</code></pre>

<p>I figure reading input file data into arrays is likely easy using <code>java.io.BufferedReader</code> is there a way not to use that?
I looked at this: <a href="http://stackoverflow.com/questions/2788080/reading-a-text-file-in-java?rq=1">Reading a text file in Java</a> but I'm stuck thinking this is a different implementation.</p>

<p>I want to try to process all the information through understandable arrays and maybe at least 2-3 methods (in addition to the main method that reads and stores all data for runtime). But say I want to use that data and find percentages and stuff (like the output). Figure out the winner...and maybe even alphabetize the results!</p>

<p>I want to try something and learn how the code works to get a feel of the concept at hand. ;c</p>
