Question: 2. 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. 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 2. 3. 4. 5. array has ROW rows and COL columns, where ROW and COL are class constants. Create a method to print the array Create a method to find the largest element in the array Create a method to find the smallest element in the array 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 219 384 152 327 33 76 381 303 43 254 393 399 149 428 84 3 113 356 155 153 409 67 370 205 161 114 433 466 262 3 57 256 273147 5 440 174176 208 224 79 348 276 361 107 451 379 140 294 150 14 214 428 380 78 83 249 420 433 224 337 189 425 42 311 126 26 362 230 318 207 88 308 120 145 210 399 191 487 498 203 332 41 345 142 129 418 198 104 83 456 32 144 283 172 248 193145 343 382 52 27 446 468 421 73 480 48 166 75 451 143 499 434 450 74 149 165 466 157160 135 433 5 487 262 157 376 266 368 435 432 359 52 27 Second row elements are: 219 384 152 327 33 76 381 303 43 254 393 399 149 428 84 Third column elements are: 5 150 311 498 172 75 281 152 113 262 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
Get step-by-step solutions from verified subject matter experts
