Results 1 to 2 of 2
- 12-22-2007, 10:19 PM #1Member
- Join Date
- Dec 2007
- Rep Power
I am making a quiz, and storing the questions in a textfile. I managed to call the questions from Java. Now i'm doing the answer part. Which is the best method of storing the answers so that i could then compare them with the answers entered by the user and determine whether the user answered correctly or not? Thanks a lot! :-):)
- 12-23-2007, 04:57 AM #2
If you know the number of questions you have you can make up an array to store the user-entered answers.
If not you can use an ArrayList to store the answers.
String answers = new String[numberOfQuestions]; for(questions asked) answers[j] = nextLine List<String> list = new ArrayList<String>(); for(questions asked) list.add(nextLine)