title: Trying to write a program that simulates a craps using specific rules
body: <p>this is the question:</p>
  
  <p>In the game of craps, a pass line bet proceeds as follows: Two six-sided dice are rolled; the first roll of the dice in a craps round is called the " come out roll." A come out roll of 7 or 11 automatically wins, and a come out roll of 2,3 or 12 automatically loses. If 4,5,6,8,9 or 10 is rolled on the come out roll, that number becomes "the point". the player keeps rolling the dice until either 7 or the point is rolled. If the point is rolled first, then the player wins the bet. if a 7 is rolled first, then the player loses</p>
  
  <p>Write a program that simulates a craps using these rules without human input. Instead of asking for a wager, the program should calculate whether the player would win or lose. the programs should simulate rolling the two dice and calculate the sum. Add a loop so that program plays several times. Add counters that count how many times the player wins, and how many times the player loses. at the end of playing the games several times, computer the probability of wining ( wins/sins+losses)) and output the value</p>
  
  <p>and this is what I did so far</p>
  
  <pre><code>  import java.util.Scanner;
  
      public class partb1
   {
  
      public static void main(String[] args)
   {
  
  int side1=1, side2=1 , roll=1, lose=0, win=0, point=0, answer;
       Double winprob, loseprob;
  
  side1= 1+(int)(Math.random() *6);
  
       side2= 1+(int)(Math.random() *6);
  
       Scanner kb = new Scanner(System.in);
  
       do
       {
       roll = side1+side2;
  
  
       if ( roll == 7 || roll == 11)
       {
         System.out.println(" Come out wins");
       winprob = win + 1;
  
       }
       else if ( roll ==2 || roll ==3 || roll ==12)
       {
         System.out.println(" Come out loses ");
        loseprob = lose +1;
  
       }
  
       else
       {
            side1= 1+(int)(Math.random() *6);
       side2= 1+(int)(Math.random() *6);
       point = roll;
     roll = side1+side2;
  
         System.out.println("The point");
         System.out.println("You won the bet");
         winprob = win + 1;
     while(roll != point || roll!= 7);
          side1= 1+(int)(Math.random() *6);
       side2= 1+(int)(Math.random() *6);
      roll = side1+side2;
  
       }
  
  
  
       if( roll ==7)
  
       {
         System.out.println("You lost the bet");
       answer = kb.nextInt();
       } 
       else if (roll == point) {
          System.out.println(win);
      }
  
    while(true)
         {
      System.out.println(" Do you want to play again? 0 for No, any number for Yes ");
  
                       if (answer ==0)
                       {
                         break;
                       }
  
                       winprob = (40/(40+60));
                       System.out.println(" The probability of wining is " + winprob);
  
                       loseprob = (40/(40-60));
                       System.out.println(" The probability of losing is " + loseprob);
  
  
  
  
          }
        }
        }
         }
  </code></pre>
  
  <p>I keep getting this error</p>
  
  <pre><code>    1 error found:
      File: H:\assignment 3\partb1.java  [line: 84]
      Error: Syntax error, insert "while ( Expression ) ;" to complete DoStatement
  </code></pre>
  
  <p>I'm not sure whether I missed something or did something wrong?
  Any clue?</p>