title: I'm having trouble with nesting do while and else if?
body: <p>so I'm really confused on why my code isn't working. So this is what I have so far:</p>
  
  <pre><code>    Scanner keyboardInput = new Scanner(System.in);
  
      System.out.println(prompt1);
      int value1 = keyboardInput.nextInt(), qAnswered=0; 
      String schoolMas, school;
      String answer;
      do  {
          if(qAnswered==0) {
              schoolMas = "Sooners";
              school = "Univeristy of Oklahoma";              
          } else if(qAnswered==1) {
              schoolMas = "Badgers";
              school = "University of Wisconsin";
          } else if(qAnswered==2) {
              schoolMas = "Wolverines";
              school = "University of Michigan";
          } else {
              schoolMas = "Cornhuskers";
              school = "University of Nebraska";
          } 
  
  
          if(value1 == 1) {
                  System.out.println("Answer with one of: " + schoolOptions + ". ");
                  System.out.println(schoolMas +"?");
                  keyboardInput.next(); //two skip new comment
                  answer = keyboardInput.next();
              if(answer.equalsIgnoreCase(school)) {
                  score = score + 1; 
                  }
                  else if(answer.equalsIgnoreCase("I don't know")) {
                      score = score + 0; 
                  }
                  else {
                      score = score + -1;
                  }
              qAnswered ++;
              }
  
          else if(value1 == 2) {
              System.out.println("Answer with one of: " + mascotOptions + ". ");
              System.out.println(school +"?");
              keyboardInput.next();
              answer = keyboardInput.next();
              if(answer.equalsIgnoreCase(schoolMas)) {
                  score = score + 1;
                  }
              else if(answer.equalsIgnoreCase("I don't know")) {
                  score = score + 0;
              }
              else {
                  score = score + -1;
              }
              qAnswered ++;
          }
          else if(value1 ==3) {
              break;
          }
  
      } while(qAnswered &lt; 4&amp;&amp; value1 !=3 );
  </code></pre>
  
  <p>and when I run the program this happens:
         " In this game, I ask you four questions about mascots for US collegiate sports teams.
  You get 1 point for each correct answer, 0 points if you type don't know, and you lose a point for wrong answers.</p>
  
  <p>Type 1 and I'll give you the mascot and you give give the school. 
  Type 2 and I'll give you the school and you give me the mascot. 
  Type 3 and I'll quit.
  1
  Answer with one of: University of Michigan, University of Nebraska, University of Oklahoma, University of Wisconsin. 
  Sooners?
  university of oklahoma
  Answer with one of: University of Michigan, University of Nebraska, University of Oklahoma, University of Wisconsin. 
  Badgers?
  university of wisconsin
  Answer with one of: University of Michigan, University of Nebraska, University of Oklahoma, University of Wisconsin. 
  Wolverines?
  Answer with one of: University of Michigan, University of Nebraska, University of Oklahoma, University of Wisconsin. 
  Cornhuskers?
  "</p>
  
  <p>The problem is between where it says "Wolverines" and "Answer with one of..." I can't type in the answer for the school. How can I solve this?
  I tried changing the last else to else if, but when I do that I get errors.
  Thank you!</p>