Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Re: Changing strings in a switch statement n stroing it in an array

    You need to do some debugging to see what the code is doing.
    See post#20


    Continued at:...
  2. Re: Changing strings in a switch statement n stroing it in an array

    Please explain what that means.
    The nextInt() method will read numeric characters representing an int value and convert them to an int.

    Try this to see what is happening. Call next() instead of...
  3. Re: Changing strings in a switch statement n stroing it in an array

    How are you debugging the code? Have you added the println statements I suggested so you can see what the code is doing?

    You should print out the contents of the testMarks array frequently to see...
  4. Re: Changing strings in a switch statement n stroing it in an array

    What makes the code stop reading the lines?

    You need to do some debugging as I suggested in post#8
    Try debugging the code by adding some println statements to print the line that is read and the...
  5. Re: Changing strings in a switch statement n stroing it in an array

    What problems are you having with the program?
  6. Re: Changing strings in a switch statement n stroing it in an array

    What problems are you having with the program?


    What conversion need to be done with the 4 Strings?


    An array can only hold one data type. You can not store both int and String in the same...
  7. Re: Changing strings in a switch statement n stroing it in an array

    Sorry, I have no idea what you said.

    The Scanner class methods that the code uses must be used in the same order that the data is in the file.
    If there are 5 numeric values in the file, then the...
  8. Re: Changing strings in a switch statement n stroing it in an array

    There shouldn't be any problems storing int values into a variable or array if the variable's definition is in scope where you are trying to access it.
    Can you explain what problem you are having?...
  9. Re: Changing strings in a switch statement n stroing it in an array

    Print out the values that the code is working with as I suggested in my last post. You need to see what the computer sees to understand what the problem is.
  10. Re: Changing strings in a switch statement n stroing it in an array

    Can you be more specific? What happens when the code executes?
    Try debugging the code by adding some println statements to print the line that is read and the tokens used in the switch statement so...
  11. Re: Changing strings in a switch statement n stroing it in an array

    Don't close the Scanner until you are finished using it.

    The code is poorly formatted. The ending }s should be inline below the start of the the statement with the matching {.
    Too many of the }s...
  12. Re: Changing strings in a switch statement n stroing it in an array

    Can you explain what that means? What does "not working" mean? What is a "second scanner"? Post the names of any program variables that you are talking about.

    If there are error messages,...
  13. Re: Changing strings in a switch statement n stroing it in an array

    Can you explain what problems you are having?

    Please edit your post and wrap your code with


    <YOUR CODE HERE>

    to get highlighting and preserve formatting.
Results 1 to 13 of 13