Before I can help you I could do with clarifying your problem a little bit.
So you generate a 5 digit number which the user has to guess. For example 12345?
The user then enters a guess, say 21345
You should respond with Lower
The user then enters 11234
You should respond higher
when the user then enters 12345
you return Correct and exit the program.
Is this the problem you have to solve or have I missed something?
If this is correct then I would do the following:
- generate the 5 digits and slap them together into 1 number. You can do this by multiplying the digit by the correct factor or append a String with each digit and convert at the end.
- enter the loop checking the users inputs. Remember check the length is 5 and that they have entered a number.
- output the correct response
- If the correct number was found then exit the loop.
If I have made an incorrect assumption or you need more help just let me know
