Im new to java and just trying to figure out the basics. i cannot figure out what is wrong with my program. Any suggestions on whats wrong?
4import java.util.Scanner;
5
6public class Lottery
7{
8 public static void main(String[] args)
9 {
10 //Generate random lottery numbers
11 int lottery = (int)(Math.random() * 1000);
12 System.out.printf("%d" , lottery);
13
14 //Create Scanner
15 Scanner input = new Scanner(System.in);
16 System.out.print("Enter your lottery pick (three digits): ");
17 int guess = input.nextInt();
18
19 //Determine whether or not the entered guess is some kind of match
20 if(guess == lottery)
21 System.out.println("Exact mactch: you win $10,000");
22 else if (guess % 100 == lottery / 100 &&
23 guess / 100 == lottery % 100 &&
24 guess % 10 == lottery / 10 &&
25 guess / 10 == lottery % 10)
26 System.out.println("Match all digits: you win $3,000");
27 else if (guess % 100 == lottery / 100 ||
28 guess % 100 == lottery % 100 ||
29 guess / 100 == lottery / 100 ||
30 guess / 100 == lottery % 100 ||
31 guess % 10 == lottery / 10 ||
32 guess % 10 == lottery % 10 ||
33 guess / 10 == lottery / 10 ||
34 guess / 10 == lottery % 10 )
35 System.out.println("Match one digit: you win $1,000");
36 else
37 System.out.println("Sorry, no match");
38 }
39}