There are a lot of different things there. What have you tried so far, and what
specifically (one thing at at time) are you having trouble with?
For instance, from reading that, I might guess that you don't know how to get user input, so I might direct you to google for
java IO tutorial. Or I might guess that you don't know anything about arrays, so I might suggest you google for
java array tutorial.