wood burning stoves 2.0*
The moose likes Java in General and the fly likes I require some Help!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "I require some Help!!" Watch "I require some Help!!" New topic

I require some Help!!

Rand Norwood

Joined: Jul 13, 2005
Posts: 1
Im not very experienced in java and im having a problem with one of the questions.
Here is the exercise:

Im suppose to write a problem that eccepts a 5-letter word from user
and then it generates all possible three letter words or combinations that can be derived from the 5-letter word.

Please in anyway u can.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

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?

GenRocket - Experts at Building Test Data
marc weber

Joined: Aug 31, 2004
Posts: 11343

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.

Third, consult the API documentation...
1.4.2: http://java.sun.com/j2se/1.4.2/docs/api/index.html
1.5.0: http://java.sun.com/j2se/1.5.0/docs/api/index.html

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
Dale Seng
Ranch Hand

Joined: Mar 22, 2004
Posts: 275
Are these words supposed to be in the dictionary, or just every possible combination?
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Please show us what you have tried and explain what problems you have encountered. We will be more than happy to help you from there.


Java API Documentation
The Java Tutorial
Paul Santa Maria
Ranch Hand

Joined: Feb 24, 2004
Posts: 236
Hi -

Marc's advice is perfect: try to find the "pieces" of the problem (for example: "accept user input", then "accept 5 characters of user input and treat those 5 characters as a word", etc etc).

So how far have you gotten? Have you identified any "pieces" yet? Have you tried typing in any code and running it yet?

It's OK no answer "no" to any/all of these questions. Just let us know how far you've gone, and where you're stuck. We'd be happy to help!

Sincerely .. PSM
[ July 13, 2005: Message edited by: Paul Santa Maria ]

Paul M. Santa Maria, SCJP
vijaya bharath
Ranch Hand

Joined: Jun 10, 2005
Posts: 66

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.

Regards,<br />Vijaya Bharath.<br />SCJP1.4 <br />SCWCD5.0
subject: I require some Help!!