java lottery code
java lottery code
With generated random #, how I can get the code to match step 2 ("You hit the digits: earns $ 3,000?
java.util.Scanner import; LotteryMatch public class (public static void main (String [] args) (/ / Generate lottery lottery int = (int) (Math.random () * 1000 + 1) System.out.println ("the lottery is" the lottery +) / / user of the system for a scanner input assumption = New Scanner (System.in); System.out.print ("Enter your selection in the lottery (three digits):"); input.nextInt guess = int (); / Time to guess if (guess == lottery) System.out.println ("Match: win $ 10,000") else if (guess == 10% lottery / I guess 10 & & / 10% of the lottery == 10) / / & & I guess that 10% of the lottery ==% 10) System.out.println ("You hit digits: earns $ 3,000), more if (% guess the lottery == 10 / 10 | | guess ==% 10% Lottery 10 | | I suppose / 10 == lottery / 10 | | I suppose / 10% of the lottery == 10) System.out.println ("You matched one digit: Win $ 1,000"); else System.out.println (" Sorry, you do not have parties ");))
I would say make the outcome of the lottery and lottery selection for strings and the use of methods string to compare strings or any of its parts …
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.