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