Question: can someone solve these for me? thanks. Assignment Instructions Problem 1: Explain what this method is doing. To use it, create a new JAVA project



Assignment Instructions Problem 1: Explain what this method is doing. To use it, create a new JAVA project and write a main method, too. Call Mystery method from main at least two times with different parameters. public static boolean Mystery(int first, int second) { boolean result = false; while (first > 0) { if (first % 10 == second) { result = true; } first /= 10; } return result; } Problem 2: Explain what method zeroDigits is doing. Create a new JAVA project and add a main method, too. Call zeroDigits method from main at least two times with different parameters. public static int zeroDigits(int number) { int count = 0; do { if (number % 10 == 0) { count++; } number = number / 10; } while (number > 0); return count; } Problem 3: Using for loop(s), print the following: 1+2 2+3 3+4 4+5 5+6 6+7 7+8 What to pay attention to? There is a repeating pattern in data, so you can take advantage of it and write iterative code. Problem 4: Define a for loop to find the following output. Be careful about the pattern here - it is quite complex. Look what the first number is in what you sum up, and look what the second number is. JAVA should do calculation of the result of the sum, do not do it as a person. One way to check whether you are writing good code is to ask yourself whether the pattern could be continued, without human calculations. 1+2 = 3 2+3 = 5 4+5 = 9 8+9 = 17 16+17 = 33 32+33 = 65 64+65 = 129
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
