Question: In java Write a program which does the following: Ask the user for the dimensions of a 2D Arrays. Requires 2 integers for rows and

In java Write a program which does the following:

  • Ask the user for the dimensions of a 2D Arrays. Requires 2 integers for rows and columns. Minimum should be 5, maximum should be 10.
    • NOTE: Dimensions cannot be negative and you must enforce this and size using proper error checking with loops.
  • Generate an array and populate it with random integers from 100 to 999 inclusive.
  • Once the array has been created display the following results:
    • Display the array in table format. (Print the 2D array). Make sure to print it with all the rows and columns neatly aligned.
    • Calculate and display the sum and average of the entire array.
    • Determine how many concentric rings (i have provided what rings are with the image below) the table contains and print that out number.
    • Print out the contents of each ring on a separate line.
      • The elements should be ordered from the top right corner of each ring going clockwise.
    • Calculate and display the sum and average of each ring.
    • Indicate which ring has the highest average.
    • Indicate which ring has the lowest average.
    • Display the max and min values in each of the rings.
  • Write separate methods for each calculation. ex: static double findAverage(int testArray[][]);
  • Round results to 2 decimal places (again see System.out.printf()).

Partial sample output of a 6-column 5-row array:

The 'rings' are indicated in green (for demo purposes only, your program will not show that graphic, just the table).

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!