Here is the question assigned to me in class...
Suppose you want to develop a program to play lottery. The program randomly
generates a lottery of a two-digit number, prompts the user to enter a two-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 $10,000. 2/2
b. If all the digits in the user input match all the digits in the lottery, the award is
c. If one digit in the user input matches a digit in the lottery, the award is $800.
Note that, in the program, make sure that the lottery number generated must be two
So far I have created the random generator and scanner to get the user input. The problem I am having though is for example if i get a number 1-9, how can i make that into 2 digits for example 09 or 07 etc. I'm sure I have to use decimalformat but that doesnt seem to work. Also, I am having a problem detecting each individual digit. I know I have to use the number%10 but then how do i get the first digit. Any help would be greatly appreciated.