Question: please write this program by JAVA, thank you. public class IOLab // rows // data. Iength; data [i].length; private double [][] data; cols public static

![// rows // data. Iength; data [i].length; private double [][] data; cols](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4edf79ce12_73466f4edf6eae2a.jpg)
please write this program by JAVA, thank you.
public class IOLab // rows // data. Iength; data [i].length; private double [][] data; cols public static void main( String [ args throws IOException 10Lab fileTest new 10Lab ( ); fileTest.readData System.out.println( fileTest.tostring) fileTest.writeData) public void readData() throws IOException Scanner console new Scanner ( System.in ); System.out.print "Please enter a file name to read: " String inFile = console . next(); /I connect to the file File file = new File ( inFile ); scanner tokens = new scanner( file ); // buffer the data int nrows = tokens.nextInt(); // get the number of rows. // 1. get the number of cols // 2. allocate space for the 2-d data array instance field: 11 3. write a nested loop to read the data into the data array /1 4. close the file: ) // end readData () public void writeData throws IOException
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
