import java.util.*; public class PickThreeGame { public static void main(String[] args) { Random generator = new Random(); Scanner in=new Scanner(System.in); int amount=5000; System.out.println("Let's Play Pick 3 Lotto. You start with $" + amount); System.out.println("You get 500 times your bet if you match all 3 numbers in the right order."); System.out.println("You get 167 times your bet if you match all 3 numbers in any order."); System.out.println("You get 100 times your bet if you match 2 of the 3 numbers in the right order."); System.out.println("You get 25 times your bet if you match 2 of the 3 numbers with one number in the right order."); System.out.print("Enter your wager: "); int wager=in.nextInt(); System.out.print("Pick your first number (0-5): "); int g1=in.nextInt(); System.out.print("Pick your second number (0-5): "); int g2=in.nextInt(); System.out.print("Pick your third number (0-5): "); int g3=in.nextInt(); int num1=generator.nextInt(6); int num2=generator.nextInt(6); int num3=generator.nextInt(6); System.out.println("The Lotto numbers are: " + num1 + ", " + num2 + ", and " + num3); int payoff; if(g1==num1&&g2==num2&&g3==num3) { payoff=wager*500-wager; System.out.println("You win on a straight bet, your payoff is $" + payoff + ", Congratulations!"); } else if((g1==num2&&g2==num3&&g3==num1)||(g1==num2&&g2==num1&&g3==num3)|| (g1==num3&&g2==num2&&g3==num1)||(g1==num3&&g2==num1&&g3==num2)||(g1==num1&&g2==num3&&g3==num2)) { payoff=wager*167-wager; System.out.println("You got the three numbers, but not in the right order, your payoff is $" + payoff + ", Congratulations!"); } else if((g1==num1&&g2==num2)||(g1==num1&&g3==num3)||(g2==num2&&g3==num3)) { payoff=wager*100-wager; System.out.println("You matched two of three numbers in the right order, your payoff is $" + payoff + ", Congratulations!"); } else if((g1==num1&&g2==num3)||(g1==num1&&g3==num2)||(g2==num2&&g3==num1)||(g2==num2&&g1==num3)||(g3==num3&&g1==num2)||(g3==num3&&g2==num1)) { payoff=wager*25-wager; System.out.println("You matched two of three numbers, with one number in the right order, your payoff is $" + payoff + ", Congratulations!"); } else System.out.println("I'm sorry, you lose your $" + wager + " bet."); } }