Question: Question : How to create a two-dimensional Integer array list of size 6X4. in Java, Following these requirements: 1) First 3 columns, 5 rows you

Question: How to create a two-dimensional Integer array list of size 6X4. in Java, Following these requirements:

1) First 3 columns, 5 rows you can generate any random numbers.

2) 4th column for first 5 rows will be the sum of corresponding row values.

3) 6th row, first 3 columns will be the sum of corresponding column values.

4) 6th row and 4th column value is made 0.

For Example:

To Generate random numbers you can use (int) (Math.random() * 10), make sure or you can use Random class from Java.util.Random, if you use Random Class use nextInt(10) method (this will generate number from 0-9 integer value).

Output: (** I do not need to print the lines or squares, just the information or data)

X Column 1 Column 2 Column 3 Column 4
Row 1 2 1 4 7
Row 2 3 2 5 10
Row 3 4 2 1 7
Row 4 5 1 2 8
Row 5 6 2 1 9
Row 6 20 8 13 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!