### 2018-09-21 While

posted Sep 21, 2018, 5:48 AM by Konstantinovich Samuel   [ updated Sep 21, 2018, 10:19 AM ]
 Goal: While we are learning Strings... we need loopsIf you need a better seat because of vision, OR you have a name you prefer to be called instead of your official first name: please fill this out: https://goo.gl/forms/JIE8eoHyk4WQXhW93Lab + Homework:codingbat -> warmup2 -> stringTimesfrontTimescountXXdoubleXstringBitsstringSplosionString-2 doubleChar countHiin python:```while boolean: body``````x = 0 while x < 10: #some more code x = x + 1```in netlogo:```while [boolean] [ ;body ]````let x 0while [ x < 10][ ;some code set x (x + 1) ]`in java:```while(boolean){ body }``````int x = 0;while(x < 10){ //some code here x = x + 1; }```GENERIC CODE:1. To start, evaluate the boolean when it is true go to INSIDE_LOOP and do step 2, but when it is false go to AFTER_LOOP  and you are done.2. When you go inside the body, you execute the entire code block. After the body of the loop completes go back to boolean (go back to the step 1).while (boolean){       //INSIDE_LOOP}//AFTER_LOOPPrint individual characters in a string:String s = "doa what"          //01234567int i = 0;while (i < s.length()){   System.out.println(s.substring(i, i +1)); // s.charAt(i) i = i + 1; //OR: i += 1; //OR: i++; }Note that:a) <= would cause an exception because index 8 doesn't exist, but the length is 8. b) length() is a method Make a string with every other chraracter:String s = "doa whatever";          //012345678901String result = "";int i = 0;while (i < s.length()){   result += s.charAt(i); i = i + 2; }//Now result is every even index of s, or just "dawaee"