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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started