Question: JAVA Write a program which does the following: Give the user a menu choice Option 1: Randomly Generate a 2D array. This option will ask

JAVAJAVA Write a program which does the following: Give the user a

Write a program which does the following: Give the user a menu choice Option 1: Randomly Generate a 2D array. This option will ask the user for the number of rows and columns in the array, as well as the range of numbers to generate, (i.e. The user can choose the min and max of the random number formula.) The random numbers should be integers, Option 2: Populate an array using File I/O. This option will ask the user to enter the name of a file OR use JFileChooser to read data from an input file. The file will have the following format: The first two numbers will be the dimensions of the array (rows and columns). The rest of the numbers will be the data for the array. Once the array has been created using one of the above two options. Display the following results: Display the array in table format. (Print the 2D array) Calculate and display the sum and average of the entire array, Calculate and display the sum and average of each row Calculate and display the sum and average of each column. Calculate and display the sum and average of the major and minor diagonals *see below. Display the row and col with the highest average, Display the row and col with the lowest average. Be sure to use appropriate methods or the program will be worth no credit. Major Diagonal: runs from upper left to lower right 123 123 12 345 456 34 789 56 Minor Diagonal: runs from upper right to lower left 123 123 12 345 456 34 789 56

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!