The first task is easy, theres so many ways to do it that I'd be suprised if you need help with that.
Second task - you can use the .length function on an inputted String [int inputStringLength = String.length()], from there you can fuck about with it by using a Character Array, or even parts of the String class, such as CharAt() or subString()
Hope that helps - let me know if you need specific help, I have not programmed in Java in over a year, my mind is flooded.
When twilight dims the skies above
Recalling thrills of our love
There's one thing I'm certain of