title: error in an election program with while loop
body: <p>I wrote this program to calculate the total number of votes that each person got in an election, and to enter multiple districts.  When I try to enter another district the program just prints out the votes received from the first district instead of setting up another poll.  What is wrong with it and how do I fix it?</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Election{
      public static void main (String[] args){
          int votesForPolly = 0;  // number of votes for Polly in each precinct
          int votesForErnest = 0; // number of votes for Ernest in each precinct
          int totalPolly = 0;     // running total of votes for Polly
          int totalErnest = 0;    // running total of votes for Ernest
          String response = "";    // answer (y or n) to the "more precincts" question
  
          Scanner scan = new Scanner(System.in);
  
          System.out.println ();
          System.out.println ("Election Day Vote Counting Program");
          System.out.println ();
          // Initializations
  
          // Loop to "process" the votes in each precinct
          {
              System.out.println ("Enter Votes? Enter Y or N");
              response=scan.next().toUpperCase();
              if (response.equals("Y")){
                  response="Yes"; 
                  System.out.println ("Enter votes for Polly:");
                  votesForPolly=scan.nextInt();
                  totalPolly=totalPolly+ votesForPolly;
                  System.out.println ("Enter votes for Ernest:");
                  votesForErnest=scan.nextInt();
                  totalErnest=totalErnest+ votesForErnest;
                  System.out.println ("Enter another District? Enter Y or N");
                  response=scan.next().toUpperCase(); 
              }else{
  
                  int count = 0;
  
                  while (count == 1){ 
  
                      // Print out the results
  
                  }
              } 
              System.out.println ("Total votes for Polly is: " + totalPolly);
              System.out.println ("Total votes for Ernest is: " + totalErnest); 
          }
      }
  }
  </code></pre>