Search:

Type: Posts; User: Norm

Search: Search took 0.18 seconds.

  1. Replies
    13
    Views
    1,908

    Re: Writing Integers to a file

    Use an if statement to test if the String is empty and don't use it if it is.
  2. Replies
    13
    Views
    1,908

    Re: Writing Integers to a file

    Test the variable being passes to the parseDouble() method and make sure it is not an empty string:
    If string is not empty
    call parseDouble
    else
    don't call parseDouble
  3. Replies
    13
    Views
    1,908

    Re: Writing Integers to a file

    That error happens in the processFile() method at line 46 where it calls the parseDouble() method.
  4. Replies
    13
    Views
    1,908

    Re: Writing Integers to a file

    How many numbers does it read?
    How many numbers are written to the file?
    What happens to the first number that is read?

    When do you expect the code to exit the while() loop?
    What is the value...
  5. Replies
    13
    Views
    1,908

    Re: Writing Integers to a file

    How does the code execute now?
  6. Replies
    13
    Views
    1,908

    Re: Writing Integers to a file

    There are a couple of coding conventions you are not following:
    You should always use {}s with loops to enclose the code that is in the loop. Same for if statements.
    Nested statements within loops...
  7. Replies
    13
    Views
    1,908

    Re: Writing Integers to a file

    The condition for the while statement should be completely inside the ()s.

    How can the code execute with compiler errors?
Results 1 to 7 of 7