Question: (In Java): Complete the method readElevationData(File f). This method should read the elevation data from file f into a 2D array and return that array.

(In Java): Complete the method readElevationData(File f). This method should read the elevation data from file f into a 2D array and return that array. Note that your method should work for any data file formatted the same way as the provided input file. The number of rows in the data file does not necessarily need to match the number of columns. However, you can assume each row contains the same number of columns.

Make the method throw three possible types of exceptions: a. FileNotFoundException if the file is not found b. ArrayIndexOutOfBoundsException if the file doesnt have a consistent number of columns in each row c. NumberFormatException if the file contains non-integer data

The input text file is a 480x480 matrix of surface elevations.

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!