title: How do I ask if the user would like to continue the game after each dice roll in java using netbeans?
body: <p>I need help with this question:</p>
  <p>A dice rolling game is played with two six-sided dice. A user playing the game, will roll the two dice and two random numbers between one and six will be generated. The sum of the two numbers will be used to decide the next step.</p>
  <p>If the sum is 2,3 or 12 then the player wins. If the sum is 7 or 11 then he/she loses. If the sum is 4, 5, 6, 8, 9 or 10 then the program automatically rolls the dice again until the player wins or loses.</p>
  <p>After every dice roll, the player will be prompted for an input. The player should decide if the game should continue or not.</p>
  <p>The amount of games won and lost should also be displayed after every dice roll.</p>
  <p>I have managed to get the first part to work but unable to work out how to prompt the user if they wish to continue or how many games they have won/lost</p>
  <pre><code>public class DiceGame {
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
        
          while (true) {
              int dice1=(int)(Math.random()*6+1);
              int dice2=(int)(Math.random()*6+1);
              int sum = dice1 + dice2;
              
              System.out.println(&quot;Roll: total = &quot; + sum);
              
              if (sum==2 || sum==3 || sum==12) {
                  System.out.println(&quot;Sorry with a &quot; +  sum  + &quot; you loose :(&quot;);
                  break;
              }
              else if(sum==7 || sum==11) {
                  System.out.println(&quot;With a &quot; + sum + &quot; you win :)&quot;);
                  break;
              }
          }
      }
  }
  </code></pre>