Question: In Java Exercise 1 2D array 1. Create a 2D array with the values shown in the following figure 276 2. Write the method searchNumber
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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
