Question: 3. Write a Java program that can add two matrices, Matrix A and Matrix B and store the result in another matrix, Matrix C. An

3. Write a Java program that can add two matrices, Matrix A and Matrix B and store the result in another matrix, Matrix C. An example of matrix addition is as shown below (for 3 by 3 matrices): A 00 B 2 1 4 N WW 3 3 2 NNN 1 3 3 1 2. 1 1 II . 2 3 6 5 4 3 5 6 5 A matrix can be represented as a two-dimensional (2D) array. Your program must define and use the following methods: - Method inputMatrix(): takes a 2D array as its parameter and prompts user to input the data into the array Method addMatrixl) : takes two 2D arrays as its parameters, sums both arrays and returns the array that contains the results. - Method printMatrix(): takes a 2D array as its parameter and prints all elements in the array (one line per row) Your program must first read two matrices, add the two matrices and display all the matrices (A, B & C) as output. Name of program file to be submitted: Asg33.java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
