A Program that will ask five letters and create a possible words
hi, I'm James.. I am a new user of java, our teacher gives us a project: "Write a program that will ask five letters from the user and automatically create possible words for the given letters.",.. I search this @ google but still i can't find an idea on how to fix this, do you have any idea of this kind of problem in java?.
thank you so much..
Re: A Program that will ask five letters and create a possible words
You may wish to tell us which step *exactly* are you stuck on?
Re: A Program that will ask five letters and create a possible words
Is this a "make all possible combinations" project?
For example. given 1,2,3 : 123,132,213,231,312,321
Re: A Program that will ask five letters and create a possible words
Re: A Program that will ask five letters and create a possible words
Thread moved from members introductions
Re: A Program that will ask five letters and create a possible words
Quote:
Originally Posted by
Norm
Is this a "make all possible combinations" project?
For example. given 1,2,3 : 123,132,213,231,312,321
yap!, thanks i think that's it, coz our instructor didn't give the actual output.. what if five letters example: A,B,C,D,E.. and it will output all possible strings/words that can be formed using the letters given. how can we do that?.
thanks Norm..
Re: A Program that will ask five letters and create a possible words
Quote:
Originally Posted by
curmudgeon
You may wish to tell us which step *exactly* are you stuck on?
@ curmudgeon.. A program that will ask for five letters e.g. "A,B,C,D,E" and will ouput all possible Strings/words that can be formed using the letters given.
how can we do that?
thanks
Re: A Program that will ask five letters and create a possible words
What techniques has your instructor talked about? Did he give you any hints or clues on how to solve this?
Re: A Program that will ask five letters and create a possible words
Quote:
Originally Posted by
Norm
Is this a "make all possible combinations" project?
For example. given 1,2,3 : 123,132,213,231,312,321
Quote:
Originally Posted by
Norm
What techniques has your instructor talked about? Did he give you any hints or clues on how to solve this?
ahm, actually our instructor didn't give any hints or clues on how to solve this.. I'm trying to approach my instructor, for asking for any techniques but she's not around now in our school.
Re: A Program that will ask five letters and create a possible words
Do you know what a recursive method call is? That is a common way to solve this problem. That is what would be used when the input can be any number of letters.
If your problem will always have 5 letters, then nested loops could be used.
Re: A Program that will ask five letters and create a possible words
Quote:
Originally Posted by
Norm
Do you know what a recursive method call is? That is a common way to solve this problem. That is what would be used when the input can be any number of letters.
If your problem will always have 5 letters, then nested loops could be used.
ahm, i never try that.. do you have any syntax recursive method for letters?.. thanks
Re: A Program that will ask five letters and create a possible words
with recursion, in a loop, you take one item from the list and past the remaining items to the next level. Continue on down until only one left.