@@ -0,0 +1,1575 @@
+package java_problems.introduction;%0D%0A%0D%0Aimport java.util.*;%0D%0A%0D%0A/*%0D%0A * In this problem you will test your knowledge of Java loops. Given three%0D%0A * integers a, b, and n, output the following series:%0D%0A * %0D%0A * a + (2%5E0)b, a + (2%5E0)b + (2%5E1)b,..., a + (2%5E0)b + (2%5E1)b + ... + (2%5En-1)b%0D%0A * Input Format%0D%0A * %0D%0A * The first line will contain the number of testcases t. Each of the next t%0D%0A * lines will have three integers, a, b, and n.%0D%0A * %0D%0A * Constraints:%0D%0A * %0D%0A * 0 %3C= a,b %3C= 50%0D%0A * 1 %3C= n %3C= 15%0D%0A * Output Format%0D%0A * %0D%0A * Print the answer to each test case in separate lines.%0D%0A * %0D%0A * Sample input:%0D%0A * 2%0D%0A * 0 2 10%0D%0A * 5 3 5%0D%0A */%0D%0Apublic class JavaLoops %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A        Scanner sc = new Scanner(System.in);%0D%0A        int a, b, n;%0D%0A        System.out.println(%22Enter an integer number of test cases: %22);%0D%0A        int numCases = sc.nextInt();%0D%0A        for (int i = 0; i %3C numCases; i++) %7B%0D%0A            System.out.println(%22Enter 3 integers for a, b, and n: %22);%0D%0A        %09a = sc.nextInt();%0D%0A            b = sc.nextInt();%0D%0A            n = sc.nextInt();%0D%0A            int%5B%5D cache = new int%5Bn%5D;%0D%0A            for (int j = 0; j %3C n; j++) %7B%0D%0A                if (j %3E 0) %7B%0D%0A                    cache%5Bj%5D = ((int) Math.pow(2, j) * b) + cache%5Bj - 1%5D;%0D%0A                    System.out.print(%22 %22 + cache%5Bj%5D);%0D%0A                %7D else %7B%0D%0A                    cache%5Bj%5D = a + ((int) Math.pow(2, j) * b);%0D%0A                     System.out.print(cache%5Bj%5D);%0D%0A                %7D%0D%0A            %7D%0D%0A            System.out.println();%0D%0A        %7D%0D%0A        sc.close();%0D%0A    %7D%0D%0A%7D

Add JavaLoops