@@ -0,0 +1,1379 @@
+package codingbat.logic2;%0A%0A/*%0A * Given 3 int values, a b c, return their sum. However, %0A * if any of the values is a teen -- in the range 13..19 inclusive -- %0A * then that value counts as 0, except 15 and 16 do not count as a teens. %0A * Write a separate helper %22public int fixTeen(int n) %0A * %7B%22that takes in an int value and returns that value fixed for the teen rule.%0A * In this way, you avoid repeating the teen code 3 times %0A * (i.e. %22decomposition%22). Define the helper below and at the same indent level%0A * as the main noTeenSum(). %0A * %0A * noTeenSum(1, 2, 3) = 6%0A * noTeenSum(2, 13, 1) = 3%0A * noTeenSum(2, 1, 14) = 3%0A * %0A */%0A%0Apublic class NoTeenSumTest %7B%0A%0A  public static void main(String%5B%5D args) %7B%0A    NoTeenSumTest test = new NoTeenSumTest();%0A%0A    System.out.println(%22%3E%22 + test.noTeenSum(1, 2, 3) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.noTeenSum(2,13,1) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.noTeenSum(2,1,14) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.noTeenSum(13, 15, 3) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.noTeenSum(13, 16, 3) + %22%3C%22);%0A  %7D%0A%0A  public int noTeenSum(int a, int b, int c) %7B%0A    int sum = fixTeen(a) + fixTeen(b) + fixTeen(c);%0A    %0A    return sum;%0A  %7D%0A  %0A  public int fixTeen(int n) %7B%0A    int fixed = n;%0A    %0A    if (n==15 %7C%7C n==16) %7B%0A      fixed = n;%0A    %7D%0A    else if (n %3E= 13 && n %3C= 19) %7B%0A      fixed = 0;%0A    %7D%0A    %0A    return fixed;%0A  %7D%0A%0A%7D%0A

add tast noTeenSum