title: Editing a program to use a do while/ while loop from user input in Java
body: <p>I am fairly new to java, so I don't have much experience with the syntax, I have tried some tutorials online and have watched a few videos on while and do while loops in Java from a user input. However, every edit i try breaks my code. The program below takes an answer from the user, an integer from 1 to 20, and has if statements, that carry out the different scenarios. However, I am trying to make it so that it will keep asking the user for an answer, until they input 0. Here is a part of relevant code:</p>
  
  <pre><code>System.out.print("Type in the pokedex number of the pokemon:");
          int answer = Integer.parseInt(reader.nextLine());
          if (answer == 1){ 
                              System.out.println(
                              "\nPokemon: " + Bulbasaur.getname() +     
                              "\nType: " + Bulbasaur.getthing_about() +
                              "\nHealth: " + Bulbasaur.gethp() +
                              "\nAttack: " + Bulbasaur.getattack() +
                              "\nDefense: " + Bulbasaur.getdefense() +      
                              "\nSpecial attack: " + Bulbasaur.getspattack() +        
                             "\nSpecial defense: " + Bulbasaur.getspdefense()+ 
                              "\nSpeed: " + Bulbasaur.getspeed() +
                              "\nTotal: " + Bulbasaur.gettotal());
          }
  </code></pre>
  
  <p>.
  .
  .</p>
  
  <p>There are 19 other if statements similar to this (I know this is inefficient code, but i will be making it efficient if it loops). 
  How would I add a do while/while loop that loops these statements until 0 is entered?</p>