Question: Revise Listing 3.8, Lottery.java, to generate a lottery of a threedigit integer. The program prompts the user to enter a three-digit integer and determines whether
Revise Listing 3.8, Lottery.java, to generate a lottery of a threedigit integer. The program prompts the user to enter a three-digit integer and determines whether the user wins according to the following rules:
1. If the user input matches the lottery number in the exact order, the award is $10,000.
2. If all digits in the user input match all digits in the lottery number, the award is $3,000.
3. If one digit in the user input matches a digit in the lottery number, the award is $1,000.
Step by Step Solution
3.38 Rating (170 Votes )
There are 3 Steps involved in it
public class Exercise0315 public static void mainString args Generate a lottery int ... View full answer
Get step-by-step solutions from verified subject matter experts
