Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws IOException
- {
- int playersTotal = 0;
- int entries = 0;
- int namesIndex = 0;
- int attackIndex = 0;
- int blockIndex = 0;
- String[] playersName = new String[60];
- double[] attackScores = new double[60];
- double[] blockScores = new double[60];
- String file = "roster1.txt";
- Scanner scanner = new Scanner(new File(file));
- scanner.useDelimiter(" ");
- while(scanner.hasNextLine())
- {
- playersName[namesIndex] = scanner.next();
- System.out.println(playersName[namesIndex]);
- namesIndex ++;
- playersName[namesIndex] = scanner.next();
- System.out.println(playersName[namesIndex]);
- namesIndex ++;
- entries ++;
- attackScores[attackIndex] = scanner.nextDouble();
- System.out.println(attackScores[attackIndex]);
- attackIndex ++;
- entries ++;
- //problem occurs here:
- blockScores[blockIndex] = scanner.nextDouble();
- System.out.println(blockScores[blockIndex]);
- blockIndex ++;
- entries ++;
- playersTotal ++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement