0

Inline Code Example Here import java.util.*;

public class DiceGame {

  public static void main(String[] args){


     Random myRand = new Random();
     Scanner myScan = new Scanner(System.in);
     double money = 10.00;
     int temp2 = myRand.nextInt(6)+ 1; 
     int temp3 = myRand.nextInt(6)+ 1;
     int roll = temp2 + temp3;
     int choice = 0;
     boolean stop = 0;


     choice = myScan.nextInt(); 


     while(choice==1&&stop==0){
        if(roll % 2==0){
       System.out.println("You win .50!!Would you like to roll again? Press 0 for stop and 1 to TRY YOUR LUCK!!!");
       (money + .50);
        }else{
       System.out.println("You lose!  Would you like to roll again?");
        (money - .50);  
     }

    }   
     while(choice==2&&stop==0){ 
       if(roll % 2!=0){
       System.out.println("You win .50!!");
        (money + .50);

     } else{
       System.out.println("Sorry Please try again");    
        (money - .50);
     }


   while(choice==3&&stop==0){
       if(temp2==temp3){
        System.out.println("Yay you got DOUBLES!!!!  You win $2.00!!");    
        (money + 2.00);
        }else{
        System.out.println("Sorry you lose $2.00.  Would you like to roll again??? Enter 0 for No or 1 for Yes");
        (money - 2.00);
     }

     while(choice==4&&stop==0){
       System.out.println("What is the guess of your next roll???");



       System.out.println(temp2);
       System.out.println(temp3);
     }

     public static void printLines
      System.out.println("This is how much money you have to play $" + money + " !!!!");
       System.out.println("Would you like to bet .50 for even?: Enter 1");
       System.out.println("Would you like to bet .50 for odd? Enter 2"); 
       System.out.println("Would you like to bet $2.00 for doubles? Enter 3");
       System.out.println("Would you like to bet $5.00 for exact amount? Enter 4 and enter exact amount."); 

}
2
Contributors
1
Reply
4
Views
4 Years
Discussion Span
Last Post by DJSAN10
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.