The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Memory test game program !

I want help with this ...
This is the code, and i have taken 4 questions initially... and applied the input method to only question 1 ... i want the input scanner variable of question 1 to be stored in a variable with automatic numbering as the for loops runs till 10 my variable name changes so that i could later call the same question again and compare the answers with if condition ! for example i'm taking 10 inputs for "write 10 colors names" :
i want those inputs.. to be used later again
lets look at it step by step..
1. Show randomly 1 question out of 10.
2. The question's answers should be 10, for example .. write 10 colors, write 10 countries!
3. when the user enters all 10 answers,the program should again display the same question and ask the user to repeat the answers which he/she entered earlier !
4. If the user manages to write the answers in correct sequence in which he entered earlier, the program should add +10 score for each correct sequence answer.

Re: Memory test game program !

i have edited the details above ..

user is asked a question, to name 10 things...
those 10 things ... string.. must be later used to compare with .. the next input ..
means the same question is gonna be showed twice !
and i want to match the answers of first question which the user entered ... with the answers of the same question user will entered afterwards ...

Re: Memory test game program !

whatever answers user enters , must be compared with the previous answers!
without using arrays and arraylist

That's possbile but would be a not good coding technique. It would be possible to save 10 Strings in one String with some special character between them, but that would be very unnatural coding and a lot more work.
Or the Strings could be written to a file and read back.