Cant Seem to get my if thens to stop adding each other. I want them to go num1,num2,num3 but this program is adding all 3 together.... Rough...
import javax.swing.JOptionPane; public class Lotto { public static void main(String[] args) { String inputOneString = JOptionPane.showInputDialog( "Enter the First Digit of Your Lotto Number Pick"); int inputOne = Integer.parseInt(inputOneString); String inputTwoString = JOptionPane.showInputDialog( "Enter the Second Digit of Your Lotto Number Pick"); int inputTwo = Integer.parseInt(inputTwoString); String inputThreeString = JOptionPane.showInputDialog( "Enter the Third Digit of Your Lotto Number Pick"); int inputThree = Integer.parseInt(inputThreeString); int numberOne = (int)(System.currentTimeMillis() % 10); int numberTwo = (int)(System.currentTimeMillis()*4 % 10); int numberThree = (int)(System.currentTimeMillis()*5 % 10); int lottoNumber = numberOne + numberTwo + numberThree; int userNumber = inputOne + inputTwo + inputThree; if (userNumber == lottoNumber) { System.out.println("The Lotto Number Was " + lottoNumber + " Your Numbers Match Exactly!! You Win $10,000"); } else if (userNumber == (numberOne + numberThree + numberTwo) OR (numberTwo + numberOne + numberThree) OR (numberTwo + numberThree + numberOne) OR (numberThree + numberOne +numberTwo) OR (numberThree + numberThree + numberOne)){ System.out.println("The Lotto Number Was " + lottoNumber + " Your Numbers Match All 3 Numbers in a Different Order!! You Win $3,000"); } else if ((inputOne == numberOne) OR (inputTwo == numberTwo) OR (inputThree == numberThree)){ System.out.println("The Lotto Number Was " + lottoNumber + " Your Numbers Match 1 of the 3 Numbers!! You Win $1,000"); } else { System.out.println("The Lotto Number Was " + lottoNumber + " Your Numbers did not Match any of the Lotto Numbers. You Lose"); } } }