This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
We're not too keen on doing homework for people around here. But we are more than happy to help with problems. So what problems are you having? Have you written any code yet? Does it compile? Do you get errors?
First, start small. Break your project down into smaller pieces. (For example, first write a program that accepts a 5-letter word from the user, then verifies this by printing it back out to the console.)
Second, work smaller. Write a few lines of code, compile, and run. If there are no errors and it behaves as expected, then add a few more lines, compile, and run... If there are errors or it behaves differently than expected, then you know where the problem is.
Finally, when you get stuck, post specific questions -- preferrably with examples of your code. You might also want to specify which version of Java you're using (especially since you appear to be asking for Command Line input from the user). [ July 13, 2005: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
I cant say this is the correct way but my idea is ,after taking 5 letter word as input, take a for loop staring to end of the string. with that for loop take the first letter to last letter of the string. i think u know how to do that means if the for loop index is 1 take charat 1 and write an inner for loop and take the letters from index+1 of outer loop to the last letter. print 2 letters fro there.
if u wont get this i can tell like this, bcs u r string is 5 letter word outer for loop is from 0-4. if outer for loop index is 0 then the inner for loop starts from 1-4. u print for each turn 2 letters.