Question: (Java: no built in classes or importing anything at the top of your class) Create a class method called printArray2D that accepts a 2D integer

(Java: no built in classes or importing anything at the top of your class)

Create a class method called printArray2D that accepts a 2D integer array and prints out the values formatted such that each value occupies 4 spaces (using system.out.printf), and each row appears on its own line, beggining and ending with a "|" symbol.

Then create a class method called fillArray2D that accepts a 1D integer array that "fills in the gaps" between the numbers (see example of output below)

(Java: no built in classes or importing anything at the top of

The returned 2D array must be full and have no extra slots at the end that are considered "empty." The original array passed in the argument must remain unchanged.

// Create array and then print the filled array int [ ] arr = {2,4,8,14,19,20,24,25); print2DArray (fillArray2D (arr)) Output 2 3 1 4 5 6 7 1 8 9 10 11 12 13 14 15 16 17 18 191 | 20 21 22 23| I 241 l 25

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!