Question: In java, please FOR ALL METHODS ASSUME THE MATRICIES ARE 3 times 3 Part One: Method 1 : Public static int [ ] [

In java, please
FOR ALL METHODS ASSUME THE MATRICIES ARE 3\times 3
Part One:
Method 1:
Public static int[][] addMatricies(int[][] A, int[][] B){
}
This method takes A, and B, and adds them together. Then we return the result C.
Example:
A=
{(:[1,2,3):}
1,5,7
8,6,8
9]
I
B=
I
1
5,6 I C=
1
1
{(:[2,7,9,|):}
7,14,16,1
9,16,18,]
Method 2:
Public static int[][] subtractMatricies(int[][] A, int[][] B){
}
This method takes A, and B and subtracts B from A. Then we return the result C.
Example
A=
I
2
3
I
B=
I
5
6
I
C=
I
0
-3
-3 I
{(:[1,5,7,8,1,1,2,7,8,1,3,3,0,0,1):}
1,6,8,9,1,1,3,8,9,1,1,3,0,9,1]
Method 3:
public static int[][] createRandomMatrix(){
}
This method will create a random matrix containing numbers between 0 and 9.
Sample Result
Your last matrix can have different values as long as they are less than 10
THIS IS THE CODE GIVEN
public static int[][] addMatrices(int[][]A, int[][]B){
}
public static int[][] subtractMatrices(int[][]A, int[][]B){
}
public static int[][] createRandomMatrix(){
}
public static void printArray(int[][] array){
for(int i=0; i

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 Programming Questions!