Computer Science Canada While loop repeats even if conditions are met |
Author: | username123 [ Mon Nov 16, 2015 5:52 pm ] | ||
Post subject: | While loop repeats even if conditions are met | ||
What the title says. Here's my code:
|
Author: | Zren [ Mon Nov 16, 2015 7:31 pm ] |
Post subject: | RE:While loop repeats even if conditions are met |
Use payment.equalsIgnoreCase("visa") instead of doing 2^(lengthOfString) comparisions to check all possibilities. do {} while(); loops will always run once. It will not check the exit condition until the end of the first iteration. |