Question: JAVA JAVA JAVA JAVA JAVA Write a program in Java that prompts the user for a size of a 2D matrix. Then it populates the

JAVA JAVA JAVA JAVA JAVA

Write a program in Java that prompts the user for a size of a 2D matrix. Then it populates the matrix with random numbers from 0-9, and prints that out. Next create a new matrix that is twice the size of the old one and is populated with the numbers from the old one expanded out in 2x2 increments.

Example Dialog:

Enter the size of the matrix

3

The matrix is

0 5 2

3 5 2

9 7 1

The doubled matrix is

0 0 5 5 2 2

0 0 5 5 2 2

3 3 5 5 2 2

3 3 5 5 2 2

9 9 7 7 1 1

9 9 7 7 1 1

Another Example Dialog:

Enter the size of the matrix

2

The matrix is

6 5

6 0

The doubled matrix is

6 6 5 5

6 6 5 5

6 6 0 0

6 6 0 0

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!