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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started