Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Exercise 1 2D array 1. Create a 2D array with the values shown in the following

ID: 3751302 • Letter: E

Question

Exercise 1 2D array 1. Create a 2D array with the values shown in the following figure 276 2. Write the method searchNumber to search a number contained only in the diagonals of the 2D array using a for, do-while, and while loop The method should accept two parameters of type int. The first one is the number to be searched, and the second one indicates the kind of loop to be used. If the second parameter is 1 then the search should be done using a for loop, 2 using a do-while loop, and 3 using a while loop The method should print if the number was found 7

Explanation / Answer

OUTPUT :

Found