@@ -0,0 +1,1142 @@
+package codingbat.logic1;%0A%0A%0A/*%0A * Given a string str, if the string starts with %22f%22 return %22Fizz%22. %0A * If the string ends with %22b%22 return %22Buzz%22. If both the %22f%22 and %22b%22 %0A * conditions are true, return %22FizzBuzz%22. In all other cases, %0A * return the string unchanged. (See also: FizzBuzz Code) %0A * %0A * fizzString(%22fig%22) = %22Fizz%22%0A * fizzString(%22dib%22) = %22Buzz%22%0A * fizzString(%22fib%22) = %22FizzBuzz%22%0A */%0A%0Apublic class FizzStringTest %7B%0A%0A  public static void main(String%5B%5D args) %7B%0A    FizzStringTest test = new FizzStringTest();%0A%0A    System.out.println(%22%3E%22 + test.fizzString(%22fig%22) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.fizzString(%22dib%22) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.fizzString(%22fib%22) + %22%3C%22);%0A  %7D%0A%0A  public String fizzString(String str) %7B%0A    boolean fizz = false;%0A    boolean buzz = false;%0A    %0A    if(str.length() %3E 0)%7B%0A      fizz = str.substring(0,1).equals(%22f%22);%0A      buzz = str.substring(str.length()-1, str.length()).equals(%22b%22);%0A    %7D%0A    %0A    if(fizz && buzz)%7B%0A      return %22FizzBuzz%22;%0A    %7D%0A    else if(fizz)%7B%0A      return %22Fizz%22;%0A    %7D%0A    else if(buzz)%7B%0A      return %22Buzz%22;%0A    %7D%0A    else %7B%0A      return str;%0A    %7D%0A  %7D%0A%0A%7D%0A

add task fizzString