1. Start NetBeans and create a a new project named DataFiles 2. Enter the following in the Main class package datafiles; import java.io.FileReader; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner; /** * @author */ public class Main { public static void main(String[] args) throws FileNotFoundException { // Ask user for name of input file Scanner console = new Scanner(System.in); System.out.println("Input file: "); //inputFileName holds the name of the input file, use full path name String inputFileName = console.next(); // Ask user for name of output file System.out.println("Output file: "); //outputFileName holds the name of the input file, use full path name String outputFileName = console.next(); // construct a FileReader object using the name of the input file FileReader reader = new FileReader(inputFileName); // construct a Scanner object named in using the object named reader Scanner in = new Scanner(reader); // construct a PrintWriter object naned out using the name of the output file PrintWriter out = new PrintWriter(outputFileName); double coco; // variable to hold an input datum double sum = 0.0; // sum of the data int numData = 0; // number of data elements double mean = 0.0; // mean of the data values while (in.hasNext()) { coco = in.nextDouble(); sum = sum + coco; } // to write information to the output file out.println( "This line is in the output file"); out.println("Ther were " + numData + " data read"); out.println("The sum is " + sum); out.println("The mean of the data is" + mean); // close the output file when ready out.close(); } }