Question: Write a program that accepts two 3 times 3 matrices and invokes a method to add them together. The formula for adding two matrices is

Write a program that accepts two 3 times 3 matrices and invokes a method to add them together. The formula for adding two matrices is shown below: (a_11 a_21 a_31 a_12 a_22 a_32 a_13 a_23 a_33) + (b_11 b_21 b_31 b_12 b_22 b_32 b_13 b_23 b_33) = (a_11 + b_11 a_21 + b_21 a_31 + b_31 a_12 + b_12 a_22 + b_22 a_32 + b_32 a_13 + b_13 a_23 + b_23 a_33 + b_33) You will need: A scanner object to read the values that fill the arrays Three 2-dimensional arrays: One to store the values in the first 3 times 3 matrix One to store the values in the second 3 times 3 matrix One to store the sum of the values from the first two matrices A method that adds the two matrices using the formula above Comments where necessary A sample of the output is shown below: Enter matrix1: 1 2 3 4 5 67 8 9 Enter matrix2: 1 2 3 4 5 67 8 9 The addition of the matrices is 1.0 2.0 3.0 1.0 2.0 3.0 2.0 4.0 6.0 4.0 5.0 6.0 + 4.0 5.0 6.0 = 8.0 10.0 12. 0 7.0 8.0 9.0 7.0 8.0 9.0 14.0 16.0 18.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
