JAVA slot machine game

Discussion in 'School Work Help' started by 3liminator, Oct 20, 2010.

  1. 3liminator

    3liminator Well-Known Member

    217
    244
    0
    I'm getting this error

    SlotMachine1.java:40: while expected
    }
    ^
    SlotMachine1.java:44: illegal start of expression
    }
    ^
    SlotMachine1.java:44: reached end of file while parsing
    }
    ^
    SlotMachine1.java:45: reached end of file while parsing



    This is my code

    import java.util.Random;
    import java.util.Scanner;

    public class SlotMachine
    {

    public static void main (String[] args)
    {

    int num1, num2, num3;


    Random generator = new Random();

    num1 = generator.nextInt(9) +1;
    num2 = generator.nextInt(9) +1;
    num3 = generator.nextInt(9) +1;

    Scanner keyboard = new Scanner(System.in);

    do
    {

    System.out.println(+num1 +"|" +num2 +"|" +num3);

    if (num == num2 && num2 == num3)
    System.out.println("YOU WIN ALL 3 NUMBERS ARE SAME!");
    else
    if (num1 == num2 || num2 == num3)
    System.out.println ("2 NUMBERS ARE THE SAME.");
    else
    if (num1 != num2 || num1 != num2 || num2 != num3)
    System.out.println("NONE OF THE NUMBERS ARE THE SAME");
    }

    }
    }