Question: Write a Java program that will use a two-dimensional array and modularity to solve the following tasks: 1. Create a method to generate a 2-dimensional

Write a Java program that will use a two-dimensional array and modularity to solve the following tasks:
1. Create a method to generate a 2-dimensional array (random numbers, range 0 - 500). The array has ROW rows and COL columns, where ROW and COL are class constants.
2. Create a method to print the array.
3. Create a method to find the largest element in the array
4. Create a method to find the smallest element in the array
5. Create a method to find the sum of all elements in the array
Generate output similar to the sample output below.
Sample Output:
The array elements are:
72 353 281 223 426 188 415 391 197 214 357 285 129 381 146 219384152327 33 76381303 43254393399149428 84 433 3113356155153409 67370205161114433466262
5487262157376266368435432359 3 57256273147 52 27 5440174176208224 79348276361107451379 140294150 14214428380 78 83249420433224337189 425 42311126 26362230318207 88308120145210399 191487498203332 41345142129418198104 83456 32 144283172248193145343382 52 27446468421 73480 48166 75451143499434450 74149165466157160135
Second row elements are:
219384152327 33 76381303 43254393399149428 84
Third column elements are:
281 152 113 262 5 150 311 498 172 75
Range of values/array: 3 - 499
The sum of all elements/array = 36631
The average of all elements/array = 244.21

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!