Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Re: Having trouble splitting a text file into multiple arrays.

    When you get that message when using a java class, you need to go to the API doc and find what package the class is in and add an import statement for it so the compiler can find the class's...
  2. Re: Having trouble splitting a text file into multiple arrays.

    You were to copy the code in post#12 and replace: <arraynamehere> with the name of the array you wanted to format for printing.
  3. Re: Having trouble splitting a text file into multiple arrays.

    Where is the code that I showed you to use to format the array for printing?

    You were to copy the code and replace: <arraynamehere> with the name of the array you wanted to format for printing.
  4. Re: Having trouble splitting a text file into multiple arrays.

    Please post the code that printed out what you posted in post#15.


    No, each element in an array holds one value.

    Did you compare the numbers you printed with the numbers that are in the input...
  5. Re: Having trouble splitting a text file into multiple arrays.

    Print out the value of the String: str to see what is there to be split.

    Check the indexes you are using in the arrays. How many elements does the array placeHolder have? How many does grades...
  6. Re: Having trouble splitting a text file into multiple arrays.

    Please post the code and what is printed out.

    A good way to format the contents of an array for printing is to use the Arrays class's toString() method:
    ...
  7. Re: Having trouble splitting a text file into multiple arrays.

    Do it in separate steps:
    1) read the line with the numbers into a String
    2) split the String into parts. The split() method returns an array: See the String class's API doc.
    3) parse each String...
  8. Re: Having trouble splitting a text file into multiple arrays.

    After using split() you will need to convert the Strings to int values
  9. Re: Having trouble splitting a text file into multiple arrays.

    What technique to use depends on what the OP knows and/or what the assignment requires.
  10. Re: Having trouble splitting a text file into multiple arrays.

    Do you have a technique for getting the each of the four grades from the line that they are on?
  11. Re: Having trouble splitting a text file into multiple arrays.

    The line with the grades has more than one number on it with spaces between the numbers. parseInt() does not like those spaces and throws the exception.
    How are you going to store those four...
Results 1 to 11 of 11