@@ -0,0 +1,1302 @@
+package codingbat.logic2;%0A%0A/*%0A * For this problem, we'll round an int value up to the next multiple of 10 %0A * if its rightmost digit is 5 or more, so 15 rounds up to 20. %0A * Alternately, round down to the previous multiple of 10 if its rightmost%0A * digit is less than 5, so 12 rounds down to 10. %0A * Given 3 ints, a b c, return the sum of their rounded values. %0A * To avoid code repetition, write a separate helper %0A * %22public int round10(int num) %7B%22 and call it 3 times. %0A * Write the helper entirely below and at the same indent level as roundSum(). %0A * %0A * roundSum(16, 17, 18) = 60%0A * roundSum(12, 13, 14) = 30%0A * roundSum(6, 4, 4) = 10%0A * %0A */%0A%0Apublic class RoundSumTest %7B%0A%0A  public static void main(String%5B%5D args) %7B%0A    RoundSumTest test = new RoundSumTest();%0A%0A    System.out.println(%22%3E%22 + test.roundSum(16, 17, 18) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.roundSum(12, 13, 14) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.roundSum(6, 4, 4) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.roundSum(13, 15, 3) + %22%3C%22);%0A  %7D%0A%0A  public int roundSum(int a, int b, int c) %7B%0A    return round10(a) + round10(b) + round10(c);%0A  %7D%0A  %0A  public int round10(int n) %7B%0A    int rest = n%2510;%0A    %0A    if (rest %3E= 5) %7B%0A      n += (10-rest);%0A    %7D%0A    else if (rest %3C 5) %7B%0A      n -= rest;%0A    %7D%0A    %0A    return n;%0A  %7D%0A  %0A%7D%0A

add task roundSum