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

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

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

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!