Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions