Build a complete java program using JOptionPane that randomly generates a lottery of a three-digit number,prompts the user to enter a three-digit number, and determines whether the user wins according to the following rule:
a. if the user input matches the lottery in exact order the award is 5,000
b.if the user input matches three digits in different order, the award is 2,000
c.if any 1 or 2 digits in the user input matches the lottery the award is 5,00
Note
1 if the user keyed in less than three digits or more than 3 digits prompt an error message and urge the user to key in again the numbers.
2.use widow for input and output.
Comments
Leave a comment