Guest User

Untitled

a guest
Jul 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public static void loadData(String[] answerKey, String[] studentID, String[] studentAnswers) throws IOException
  2. {
  3. BufferedReader reader = new BufferedReader(new FileReader("C:\\VHS\\quiz.txt"));
  4. StringTokenizer tokenizer;
  5.  
  6. String line = "";
  7. int count = 0;
  8.  
  9. // Start reading entries all the way to the end of the file
  10. answerKey[0] = reader.readLine();
  11. line = reader.readLine();
  12.  
  13. while (line != null)
  14. {
  15. tokenizer = new StringTokenizer(line);
  16.  
  17. studentID[count] = tokenizer.nextToken();
  18. studentAnswers[count] = tokenizer.nextToken();
  19.  
  20. count++;
  21. line = reader.readLine();
  22. }
Add Comment
Please, Sign In to add comment