0

I cant get my while loop to work

I tried while loops and for loops and do-while loops, but I can't get it to only run once when I give the right answer or stop if it goes into the while loop it does not leave ever! My code - https://code.sololearn.com/cugyApE9Niqv/#java

25th Feb 2022, 11:48 AM
TeraGeek
TeraGeek - avatar
2 Answers
+ 3
Get all input inside of the loop. Break from the loop only then the input is valid. To check the input for validity, remember to use equals() for all string comparisons. https://code.sololearn.com/ca1F4UVL7g6y/?ref=app
25th Feb 2022, 12:04 PM
Lisa
Lisa - avatar
0
Thank you
1st Mar 2022, 5:49 AM
TeraGeek
TeraGeek - avatar