Results 1 to 2 of 2
Thread: Problem
- 12-22-2007, 10:19 PM #1
Member
- Join Date
- Dec 2007
- Posts
- 34
- Rep Power
- 0
Problem
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.
Java Code:String answers = new String[numberOfQuestions]; for(questions asked) answers[j] = nextLine List<String> list = new ArrayList<String>(); for(questions asked) list.add(nextLine)


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks