Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    23
    Views
    1,290

    Re: Do while loop skipping method 3 times

    Glad you you got it working.
  2. Replies
    23
    Views
    1,290

    Re: Do while loop skipping method 3 times

    OK, what is the condition the code needs to continue looping?

    What condition will return true so the loop will continue?

    What condition will return false so the loop will exit?


    Write a...
  3. Replies
    23
    Views
    1,290

    Re: Do while loop skipping method 3 times

    Did you see what I wrote in post#18 about a condition like what is used in the while statement?

    When do you want the do{} while to loop

    and when do you want it to exit the loop?
  4. Replies
    23
    Views
    1,290

    Re: Do while loop skipping method 3 times

    I wouldn't say unreliable. It does what it is supposed to do and requires some knowledge to be able to use.

    What it the problem with the code now? You should add comments describing what is...
  5. Replies
    23
    Views
    1,290

    Re: Do while loop skipping method 3 times

    Try using some of the Scanner class's methods. You could read into a String, check that its length is 1 and then use charAt(0) == 'X' where X is the character to test for or the equals("X") method to...
  6. Replies
    23
    Views
    1,290

    Re: Do while loop skipping method 3 times

    What char is read by the read() method? When is the condition in the while() statement true?
    Add a println() statement that prints out what is in the symbol variable so you can see what is read and...
  7. Replies
    23
    Views
    1,290

    Re: Do while loop skipping method 3 times

    Make a small, simple program that compiles, executes and shows the problem. Copy the full contents of the console window from when you execute the test program and paste it here. Add some comments...
  8. Replies
    23
    Views
    1,290

    Re: Do while loop skipping method 3 times

    Read the value returned by System.in.read() into a variable and print out its value before casting it to a char.
    You will see what values are returned by the read() method when you press the Enter...
Results 1 to 8 of 8