Question
write a program with a method that adds two matricies. The header of the method should be this: public static double[][] addmatrix(double[][] a, double[][] b)
write a program with a method that adds two matricies. The header of the method should be this: public static double[][] addmatrix(double[][] a, double[][] b) . both matricies must have the same dimensions and same types.
program should create 2-two dimensional arrays that are the same size and store double type numbers.
The main method will pass these 2 arrays down to the method addMatrix.
addMatrix will take the two arrays and create a third two dimensional array that adds the values from the two passed in arrays.
The addMatrix method then returns the new array to the main method.
Create a method to print out a two-dimensional array. The main method will then call the print method three times to print out all three arrays.
This program MUST work with any size array, ex. 4X4 or 6X6 or 12X12, etc.
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