Glad you you got it working.
Type: Posts; User: Norm
Glad you you got it working.
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...
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?
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...
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...
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...
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...
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...