// Zorah Fung, CSE 142 // An example of a "fencepost" problem public class FencepostFun { public static void main(String[] args) { printLetters("Atmosphere"); // A, t, m, o, s, p, h, e, r, e printLetters("banana"); // b, a, n, a, n, a } // Prints out the letters of the given word with commas in between public static void printLetters(String word) { System.out.print(word.charAt(0)); // must pull out the first letter (post) for (int i = 1; i < word.length(); i++) { System.out.print(", "); // (wire) System.out.print(word.charAt(i)); // (post) } System.out.println(); } }