Lab 11 Download Code For Students
Lab 11 Download Code For Students
Lab 11 Download Code For Students
import java.util.*;
import java.io.*;
import javax.swing.JOptionPane;
}
public void readData() // throws IOException
//public void readData() // throws IOException
{
Scanner console = new Scanner( System.in );
String outMsg = "Enter the input data filename (include .txt)";
// use Lab11.txt
Scanner tokens = null;
boolean repeat;
console.close();
do {
repeat = false;
String inFile = JOptionPane.showInputDialog( outMsg );
try {
File file = new File( inFile );
tokens = new Scanner( file );
//STUDENT CODE:
//write a nested loop to read the data into the data array.
} while ( repeat );
} // end readData()
//Use the toString method to create a string and write into your output file.
String myData = this.toString();
out.printf( "%s", myData );
} // end of writeData
} // end class