Jeff Sakaida wrote:
Jeff Sakaida wrote:An anagram is a word that is made using the same letters as the first word, so technically hello and hello are anagrams, and the same goes for hello and elloh, seeing as they have the exact same letters in each word. If you were to try a word that really wasn't an anagram in this program, such as state and asset, it would come back as false which is correct. I made this program to come back with these results on purpose, so that aspect of it works. I just don't understand what method I should use to have the user decide when to end the program.
Jeff Sak wrote:whenever I try to add code to the program that makes it end when the user inputs a blank line or other than two words in the line it doesn't work. I have been trying to use while loops and if else statements, but it doesn't seem to work because it is a string and not an integer.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
That is like using German grammar in English. Don't. The two languages are completely different and the similarity of the syntax is liable to confuse you.Jeff Sak wrote:. . . since I am a lot newer to Java I use code closer to C++.
It does no good to disparage your teachers.. . . He actually barely teaches in class . . .
Campbell Ritchie wrote:Don't try that for reading files...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |