title: Jcreator Voting Program
body: <p>My teacher wants us to make a program that counts the total number of votes for two candidates from a variable number of precincts. So the user inputs the candidates’ names as strings and is then prompted to enter the number of precincts prior to entering the votes for each precinct. What I am having trouble with is that I have to use an array to keep each precinct's vote total. Then after all of that is done  I have to keep a running total of the votes for each candidate after each precinct is completed and who is currently leading and by how much. I have already begun my program but I am honestly just lost as to where to go from here, and I know that what I have in my arrays so far is not correct.</p>
  
  <pre><code>import java.util.*;
  
  public class Voting
  {
      public static void main (String [] args)
      {
          Scanner scan = new Scanner(System.in);
  
          int rerun;
          int rerun2;
  
          while (rerun == 1)
          {
              System.out.print("Name of candidate 1: ");
              candidate1 = scan.next();
              System.out.print("Name of candidate 2: ");
              candidate2 = scan.next();
  
              System.out.print("\nPlease enter amount of precincts: ");
              presincts = scan.nextInt();
  
              System.out.print("\n Please enter amount of votes for     candidate 1: ");
          votes1 = scan.nextInt();
  
              System.out.print("\n Please enter amount of votes for candidate 2: ");
              votes2 = scan.nextInt();
  
              while (rerun2 == 1 &amp;&amp; precincts &gt;= 0 &amp;&amp; votes1 &gt;= 0 &amp;&amp; votes2 &gt;= 0)
              {
                  int[] votes1 = new int[precincts];
  
                  for(int i = 0; i &lt; votes1.length; i++)
                  {
                      votes1[i] = int [i];
                      System.out.println ("\n" + votes1);
                  }
  
                  int[] votes2 = new int[precincts];
  
  
                  for(int i = 0; i &lt; votes2.length; i++)
                  {
                      votes2[i] = int [i];
                      System.out.println ("\n" + votes2);
                  }
              }
          }
      }
  }
  </code></pre>