Search:

Type: Posts; User: Scippi

Search: Search took 2.67 seconds.

  1. Re: Using for loop to read in data from text file using Scanner class

    Here's a screenshot of everything, the attached file is horribly pixelated so use this link : http://i56.tinypic.com/1xxfnn.png
  2. Re: Using for loop to read in data from text file using Scanner class

    CS1 2012 Group 1 - printed first using scanner.hasNextLine()
    8 - printed second as int on a new line scanner.hasNextInt()
    One number was printed before the error which is the 8...
  3. Re: Using for loop to read in data from text file using Scanner class

    The first line is 5,5,5,6,5,8,9,5,6,8, good, very good, excellent, good and I've set the delimiter to a comma so I would've thought it'd print the first integer before crashing since I can't see...
  4. Re: Using for loop to read in data from text file using Scanner class

    Oh so sorry, yeah the Cohort and numberOfResponses get printed out fine. The program prints those two lines, then goes to print the actual data, starting with the integers, and that's when the error...
  5. Re: Using for loop to read in data from text file using Scanner class

    I mentioned this error earlier, the full content of the console is: java.util.InputMismatch exception: null(in java.util.Scanner)
  6. Re: Using for loop to read in data from text file using Scanner class

    No, I get the error everytime it gets to the line studentResponses[row][column] = scanner2.nextInt();
  7. Re: Using for loop to read in data from text file using Scanner class

    Well I've asked someone in my class to give me some pointers so I'm just trying out his method. Yeah I usually use studentResponses.length rather than a number, the 8 was just there for testing...
  8. Re: Using for loop to read in data from text file using Scanner class

    I think this should work, basically it's going to print out everything again separated by a space rather than comma and put a tab space between the numbers and the strings. However I'm still getting...
  9. Re: Using for loop to read in data from text file using Scanner class

    I see, so what modifications would you suggest I make to my code?
  10. Re: Using for loop to read in data from text file using Scanner class

    The loop that prints out everything being read in is



    for (int column = 0; column < studentResponses[0].length; column++){
    studentResponses[row][column] =...
  11. Re: Using for loop to read in data from text file using Scanner class

    Thanks for your responses. This is my attempt:



    public void readMarksData(String fileName, int numberOfStudents, int responsesPerStudent) throws FileNotFoundException
    {
    int...
  12. Using for loop to read in data from text file using Scanner class

    Hi guys,

    I'm currently stuck on a programming assignment which requires me to read in data from a text file then process it. The file looks like this:

    CS1 2012 Group 1
    8
    5,5,5,6,5,8,9,5,6,8,...
Results 1 to 12 of 12