******************************************************************************* 0) Administrative - hw: read 8.1-8.2 - questions about A3? 1) Last time- started strings, learned a bunch of methods Exercise: write pieces for a pig latin translator using these methods Hello. What street is that? ello-Hay. at-Whay eet-stray is-ay at-thay? - a helper to finds the index of the first vowel in a word - a method to turn a single word into pig latin - a helper to tell whether a character is a letter or not private int firstVowel(String word) { word = word.toLowerCase(); for (int i=0; i='A' && c <='Z') || (c >='a' && c <='z') ); } 2) Go over 9.5-9.6 in your groups 3) Highlights A. Comparing strings - references: == contents: equals() - exception: literal strings are like primitives String a = "hi", b = "hi"; if (a == b) // will be true - but as soon as you do anything with it, this changes a = a.toLowerCase(); if (a == b) // not true anymore - this is weird and inconsistent, so don't rely on it B. StringBuffers: like Strings, except mutable - has methods that allow you to change it in place - make one (like a wrapper class for a string) StringBuffer sb = new StringBuffer("cat"); - change characters sb.setCharAt(2, 'd'); -> "cad" - insert characters or strings sb.insert(1, 'h'); -> "chad" sb.insert(3, "ra"); -> "charad" - stick characters or strings on the end sb.append('e'); -> "charade" sb.append("s"); -> "charades" - delete characters sb.deleteCharAt(1); -> "carades" - reverse string sb.reverse(); -> "sedarac" - extract the String out of it sb.toString(); -> returns the String - some others; many of the same ones that String has - you'll be given a list if you need it C. Things to remember - converting back and forth b/w SB and String - don't call methods on characters 4) Finish PigLatin exercise - the hard part: putting it all together - come up with a pseudocode outline first, work out problems - use StringBuffer just for practice private String pigLatin(String s) { StringBuffer latin = new StringBuffer(""); int i = 0; while (i=s.length()) break; // Otherwise we're at the beginning of a word. int begin = i; while (i