Question: Write a program that randomly populates three 2-D arrays [3][3] size. The random number generator should only write numbers between 1-3. Once you have
Write a program that randomly populates three 2-D arrays [3][3] size. The random number generator should only write numbers between 1-3. Once you have populated three arrays, add them all together. Display the final array. This is a strong example of call by value. Suggested flow: The populate method should accept one array as an argument and populate it with random numbers. Once this is done, return the filled array back to main. Call this method for each array to be filled. Create a method called addArrays that accepts all three arrays as an argument. This method will simply add up all the indexes together and store them in a final result array. In this method call displayResult method. In main, create your arrays. Create a method called displayResult that accepts the final result array as an argument and prints it. o A great and useful way to print is to import java util.Arrays; and then print by using System.out.print(Arrays.deepToString(array));
Step by Step Solution
3.55 Rating (173 Votes )
There are 3 Steps involved in it
Java import javautilArrays public class ArrayManipulation public static ... View full answer
Get step-by-step solutions from verified subject matter experts
