PDA

View Full Version : Lottery program


ahmed166
Apr 24, 2014, 06:17 PM
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.

smoothy
Apr 24, 2014, 06:28 PM
Since that's a homework assignment. And we don't do your assignment for you. Show us what you have already. And someone can offer advice on the coding.

odinn7
Apr 24, 2014, 07:09 PM
LOL!!!! You build it and let us know how it works.

You seriously think someone here is going to do that so you don't have to?