Write a program that randomly populates three 2-D arrays [3][3] size. The random number generator should...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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)); 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));
Expert Answer:
Answer rating: 100% (QA)
Java import javautilArrays public class ArrayManipulation public static ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
A small, 2-ha, mostly impervious urban catchment has an average slope of 1.5% and the following average. Horton infiltration parameters: f0 = 4 mm/hr, fc = 1 mm/hr, k = 2.2 hr-1. (Infiltration occurs...
-
Twyla Company is a multidivisional company. Its managers have full responsibility for profits and complete autonomy to accept or reject transfers from other divisions. Division A produces a...
-
According to Bankrate, the best rate for a savings account in December 2022 was through Bask Bank paying 4.03% APY. If the stated or nominal interest rate is compounded monthly, find the stated...
-
The comparative balance sheet of Fidelity Medical Supply at December 31, 2008, reported the following: Fidelity's transactions during 2008 included the following: Requirements 1. Prepare the...
-
The balance sheet for Tactex Controls Inc., provincially incorporated in 2012, reported the following components of equity on December 31, 2013. In 2014 and 2015, the company had the following...
-
Starting on her 40 th birthday, Lynette plans to start saving for her retirement.She will contribute $8,000 to a brokerage account each year on her birthday, starting today. Her 25 th and final...
-
Jackson Manufacturing holds a 150-day note of $10,000 that has an interest rate of 7% annually. After 90 days, the note is sold to a bank at a discount rate of 6% annually. Find the proceeds on the...
-
Jordana is self employed in the T shirt distribution business, the following is Jordanas income statement, for the calendar year ending December 31. Statement of Income For the Year ended Dec 31...
-
Part A An 8.0-m-diameter, 25-m-long cylindrical spaceship needs to have an internal magnetic field with the same strength as earth's. A clever astronaut suggests wrapping the spaceship tightly with...
-
You are David the finance director of the company. David: Finally I'm done with the review. Ah.. Linda what is the matter? Linda: David, I would like to report that one of our major customers super...
-
These are financial ratios of blockbuster for the year 2006 and 2010. Based on each of these these ratios, compare and comment the financial situation of the company. Computation of Financial ratios:...
-
How do we determine the value of works of art? Is there something intrinsic to the work that determines the price? Is it simply a matter of what the market will bear?...
-
A person exerts a force of 130 N at an angle of 36 degrees to the face of the door. The door has a width of 82 cm. Find the magnitude of the torque acting on the door.
-
A billy cart rides down the side of a hill of elevation z = e--2. The cart's path in the xy-plane is given by x(t) = t. from time t = 0 to t = 1. (a) Find the parametric curve r(t) = (x(t), y(t),...
-
Draw the major product for each of the following reactions: (a) (b) (c) 1) 9-BBN 2) H2O2, NaOH 1) Disiamylborane 2) H20, NaOH
-
RC4 has a secret internal state which is a permutation of all the possible values of the vector S and the two indices and . a. Using a straightforward scheme to store the internal state, how many...
-
It can also be shown that for arbitrary positive integer \(a, \phi(a)\) is given by \[\phi(a)=\prod_{i=1}^{t}\left[p_{i}^{a_{i}-1}\left(p_{i}-1ight)ight]\] where \(a\) is given by Equation (8.1),...
-
What is the difference between Rijndael and AES?
-
A healthy diet is becoming increasingly important for consumers, especially women aged 2535. As a result, they are taking active steps to ensure they are eating healthy but are also looking for other...
-
Lael was just hired by Best East Motels into their manager training program and was excited about the potential benefits after her graduation from Florida State University. Working part-time and...
-
Sophie just completed a sales training course with one of the firms most productive sales representatives, Emma. At the end of the first week, Sophie and Emma sat in a motel room filling out their...
Study smarter with the SolutionInn App