Homework lottery

Suppose you want to play a lottery game. The program randomly generates a two-digit lottery ticket, prompts the user to enter a two-digit number, and then determines whether the user can win according to the following rules.
1) If the number entered by the user matches the actual order of the lottery, the prize is $10,000.
2) If the user enters all the numbers of all the numbers in the lottery, but the order is inconsistent, the prize is 3000 USD.
3) If only one digit is matched, the prize is 1000 USD.
4) If there is no match, the lottery ticket is invalid.

Tip: Use (int)(Math.random()90+10) to generate random numbers.Homework lotteryHomework lotteryHomework lottery

Guess you like

Origin blog.51cto.com/14981235/2554320