title: How to make a pick 3 lottery program? (java)
body: <p>First post on here because I'm frustrated. 
  The assignment is to create a program in which 3 random numbers from 0-9 are generated, and where the user will input 3 numbers. If 1 number matches - the user wins $10, if 2 - $100, if 3 - $1000, and if all 3 and in perfect order - $1000000.
  For some reason, even if none of the numbers match up, it will award me with $10, and there are other problems. </p>
  
  <p>I know there must be a simpler way. This is my first java course so I'm still a beginner but this is the code I came up with: </p>
  
  <pre><code>public class TheLottery
  {
      public static void main(String[] args)
      {
          Scanner input = new Scanner(System.in);
  
          System.out.println("enter a number from 0-9");
          int num1 = input.nextInt();
  
          System.out.println("enter a second number from 0-9");
          int num2 = input.nextInt();
  
          System.out.println("enter a third number from 0-9");
          int num3 = input.nextInt();
  
          Random r=new Random();
          int a1=r.nextInt(10);
  
          Random r1=new Random();
          int a2=r.nextInt(10);
  
          Random r2=new Random();
          int a3=r.nextInt(10);
  
          System.out.println("The winning numbers are "+ a1 + a2 + a3);
          boolean winning1=true;
          boolean winning2=true;
          boolean winning3=true;
  
          if (num1 == a1 || num1 == a2 || num1 == a3)
              winning1 = true;
          else
              winning2 = false;
  
          if (num2 == a1 || num2 == a2 || num2 == a3)
             winning2 = true;
          else
             winning2 = false;
  
          if (num3 == a1 || num3 == a2 || num3 == a3)
              winning3 = true;
          else
              winning3= false;
  
          if(winning1==true &amp;&amp; winning2==true &amp;&amp; winning3==true &amp;&amp; num1 == a1 &amp;&amp; num2==a2 &amp;&amp; num3==a3)
              System.out.println("YOU'RE A MILLIONAIRE!");
          else if (winning1==true &amp;&amp; winning2==true &amp;&amp; winning3==true)
              System.out.println("You win 1,000 dollars!");
          else if ((winning1==true &amp;&amp; winning2==true) || (winning1==true &amp;&amp; winning3==true) ||(winning2==true &amp;&amp; winning3==true))
              System.out.println("You win 100 dollars!");
          else if (winning1==true || winning2==true || winning3==true)
              System.out.println("You win 10 dollars!");
          else
              System.out.println("You lose!");
      }
  }
  </code></pre>