title: Do part of do while statement not incrementing my count of correct?
body: <p>I am trying to use a do while statement (required in this) to state the score that a person gets, however the nested if statements in my do statement seem to not be incrementing correct (i.e. it will give 0% no matter what)? What am I incorrectly writing that is not incrementing my correct variable?</p>
  
  <p>Here is my code as follows</p>
  
  <pre><code>Scanner input = new Scanner(System.in);
  int q1 = 2, //answer 1 correct answer
   q2 = 1, //answer 2 correct answer
   q3 = 3, //answer 3 correct answer
   correct = 0, //amount correct
   answer1, //store answer1
   answer2, //store answer2
   answer3; //store answer 3
  
  System.out.printf("%n Question #1.) What is the capital of Iowa?"); //display question
  System.out.printf("%n 1.) Iowa City \t 2.) Des Moines \t 3.) Dubuque"); //display answer
  System.out.printf("%n Your answer: ");
  answer1 = input.nextInt(); //input becomes initial value
  
  while (answer1 &lt; 1 || answer1 &gt; 3) //while loop to check if answer is valid
  {
   System.out.printf("%n Invalid Answer please enter a valid answer: "); //ask for input if not valid
   answer1 = input.nextInt();
  }
  
  switch (answer1) //switch statement for input types of answer1
  {
   case 1:
    System.out.printf("%n Incorrect"); //if input 1 it is incorrect
    break; //go to next part of code
  
   case 2:
    System.out.printf("%n Correct"); //if input 2 it is correct
    break;
  
   case 3:
    System.out.printf("%n Incorrect"); //if input 3 it is incorrect
    break;
  }
  
  
  System.out.printf("%n Question #2.) Where is Iowa?"); //display question
  System.out.printf("%n 1.) Midwest \t 2.) South \t 3.) Northeast"); //display answer
  System.out.printf("%n Your answer: ");
  answer2 = input.nextInt(); //input becomes initial value
  
  while (answer2 &lt; 1 || answer2 &gt; 3) //make sure answer is valid
  {
   System.out.printf("%n Invalid Answer please enter a valid answer: "); //ask for valid input
   answer2 = input.nextInt();
  }
  
  switch (answer2) //switch statement for chosen answers
  {
   case 1:
    System.out.printf("%n Correct"); //correct if input is 1
    break;
  
   case 2:
    System.out.printf("%n Incorrect"); //incorrect for answer 2
    break;
  
   case 3:
    System.out.printf("%n Incorrect"); //incorrect for answer 3
    break;
  }
  
  System.out.printf("%n Question #3.) Who is the new president of UIowa?"); //display question
  System.out.printf("%n 1.) Sally Mason \t 2.) Barack Obama \t 3.) Bruce Harreld"); //display answer
  System.out.printf("%n Your answer: ");
  answer3 = input.nextInt(); //input becomes initial value
  
  while (answer3 &lt; 1 || answer3 &gt; 3) //make sure valid answer
  {
   System.out.printf("%n Invalid Answer please enter a valid answer: "); //ask for valid answer
   answer3 = input.nextInt();
  }
  
  switch (answer3) //switch to give output depending on answer
  {
   case 1:
    System.out.printf("%n Incorrect"); //if input is 1
    break;
  
   case 2:
    System.out.printf("%n Incorrect"); //if input is 2 this statement
    break;
  
   case 3:
    System.out.printf("%n Correct"); //if input is 3 this statement
    break;
  }
  
  do {
   if (answer1 == q1) {
    correct++;
   }
   if (answer2 == q2) {
    correct++;
   }
   if (answer3 == q3) {
    correct++;
   }
  } while (correct &lt;= 3);
  if (correct == 3) {
   System.out.printf("%n 100%%");
  } else if (correct == 2) {
   System.out.printf("%n 66.67%%");
  } else if (correct == 1) {
   System.out.printf("%n 33.33%%");
  } else {
   System.out.printf("%n 0%%");
  }
  } //end method
  } //end class
  </code></pre>