Question: URGENT!!!!!! JAVA CODING QUESTION Create the following function: public static boolean checker(int square, byte[][] board){ return true} The board is divided into 9 squares. Each

 URGENT!!!!!! JAVA CODING QUESTION Create the following function: public static boolean

URGENT!!!!!! JAVA CODING QUESTION

Create the following function:

public static boolean checker(int square, byte[][] board){

return true}

The board is divided into 9 squares. Each square must include the digits 1-9. They don't have to be in order but all squares must include all digits 1-9.

The method takes a byte array and checks if each square includes all digits 1-9. It should check 1 square at a time.

The byte array looks like this:

public static byte[][] board1 = new byte[][]{

{1,2,3,4,5,6,7,8,9},

{4,5,6,7,8,9,1,2,3},

{7,8,9,1,2,3,4,5,6},

{2,3,4,5,6,7,8,9,1},

{5,6,7,8,9,1,2,3,4},

{8,9,1,2,3,4,5,6,7},

{3,4,5,6,7,8,9,1,2},

{6,7,8,9,1,2,3,4,5},

{9,1,2,3,4,5,6,7,8}};

public static byte[][] board2 = new byte[][]{

{1,2,3,4,5,6,7,8,9},

{1,2,3,4,5,6,7,8,9},

{1,2,3,4,5,6,7,8,9},

{1,2,3,4,5,6,7,8,9},

{1,2,3,4,5,6,7,8,9},

{1,2,3,4,5,6,7,8,9},

{1,2,3,4,5,6,7,8,9},

{1,2,3,4,5,6,7,8,9},

{3,4,5,2,8,6,2,7,9}};

When the method checks board1 it should return true. When the method checks board2 it should return false.

Use the following test method to check your program:

public static boolean testMethod(byte[][] board){

for(int square=0; square

if( !checker(square, board) ){

return false;

}

}

Absolutely no classes or imports can be added.

Thanks in advance.

Urgent Java Coding Question!!!! 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 1 2 3 7 8 9 1 2 3 4 5 6 2 3 4 5 6 7 8 9 1 5 | 6 | 7 | 8 | 9 | 1 2 3 4 8 9 1 2 3 4 5 6 7 5 3 4 | 5 | 6 | 7 | 8 9 1 2 6 | 7 | 8 | 9 | 1 | 2 | 3 | 4 | 5 91 2 3 4 5 6 7 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!