Question: Using a JOptionPane Create a concrete class named TwoDimArray Define the backing 2D array as an instance variable and use the integer primitive type. Declare

Using a JOptionPane

Create a concrete class named TwoDimArray

Define the backing 2D array as an instance variable and use the integer primitive type.

Declare any other instance variables required to implement the class.

Implement instance methods as outlined in the program specification and add the following methods:getArrayHighestValue(), getArrayLowetValue(), and loadArray().

prompt the user for an input file name. If the file doesn't exist or is empty, display an error message using a JOptionPane and quit. Use try-catch blocks to trap and handle exceptions.

Use the loadArray instance method to read the data from a file where the first record (line) contains two numbers: the first represents the number of rows and the second number represents the number of columns. If there is an error reading the file or if the row/column data is invalid, display an error message using a JOptionPane and quit. Subsequent records in the file will represent the array data. If there is an error reading the file or if the data is invalid or missing, display an error message using a JOptionPane and quit. Use try-catch blocks.

Use the main method as driver module to create an instance of the class and to test the various instance methods. Use System.out.println() to display all normal program output (send it to the standard output device).

Alos create a UML diagram if possible.

Sample Input File:

5 5

11 12

0 792

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!