Search:

Type: Posts; User: Norm

Search: Search took 0.19 seconds.

  1. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    What is the status of the program now?
    Any errors? Please post the full text of any error messages.
    The code execute but gives wrong results. Show results and explain what is wrong with it.
  2. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    Can you post the code that you are having problems with?
    Also post the full text of the error message and the contents of the file that you are trying to read.
  3. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    What is the arg to parseInt() where the error occurs? (line 29)
    The error message says it is the String: "2 1 1"
    A String with non-digits in it can NOT be parsed to an int.

    For debug:
    print...
  4. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    Look at line 70 in your program for the error. The error message says you are trying to index the second element in an array that does not have 2 elements.

    How are you using the split() method? ...
  5. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    What happens when you compile and execute the code? Does it work and do what you want?
  6. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    If a line has three items on it, you need to read the full line and separate it into the three parts so you can process each one as required.
    The String split() method will separate the line into...
  7. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    Can you describe what is in the file being read and what you want to do with it when you read it into the program?
  8. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    If you want to read integer values you should use the nextInt() method. The next() method returns a String.

    You should work on the logic needed to read in the data and use it in the program...
  9. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    The data on each line could be delimited (separated) by spaces instead of in fixed columns to allow for a larger range of numeric values.
  10. Replies
    41
    Views
    2,944

    Re: Help with an object based level format

    To execute java code, you need to compile it.
    For java code to compile it must be in a class and a method for most cases.

    A problem would be for the variables referenced in the code, they would...
Results 1 to 10 of 10