@@ -0,0 +1,934 @@
+package codingbat.warmup2;%0A%0A/*%0A * Given a string and a non-negative int n, %0A * we'll say that the front of the string is the first 3 chars, %0A * or whatever is there if the string is less than length 3. %0A * Return n copies of the front; %0A * %0A * frontTimes(%22Chocolate%22, 2) = %22ChoCho%22%0A * frontTimes(%22Chocolate%22, 3) = %22ChoChoCho%22%0A * frontTimes(%22Abc%22, 3) = %22AbcAbcAbc%22%0A */%0A%0Apublic class FrontTimesTest %7B%0A%0A  public static void main(String%5B%5D args) %7B%0A%0A    FrontTimesTest test = new FrontTimesTest();%0A%0A    System.out.println(%22%3E%22 + test.frontTimes(%22Chocolate%22, 2) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.frontTimes(%22Chocolate%22, 3) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.frontTimes(%22Abc%22, 3) + %22%3C%22);%0A  %7D%0A%0A  public String frontTimes(String str, int n) %7B%0A    String result = %22%22;%0A    %0A    for(int i = 0; i%3C n; i++)%7B%0A      if(str.length() %3C 3)%7B result += str;%7D%0A      else %7B result += str.substring(0, 3);%7D%0A    %7D%0A    %0A    return result;%0A  %7D%0A%0A%0A%7D%0A

add task frontTimes