Read input file & display the average
Write a short complete Java program that reads the numbers in an input file and displays on
the console the average of those numbers. The program expects a single command-line parameter that is the name of a data file. A valid data file contains any number of doubles per line each separated by whitespace. Your program should display an appropriate error message then quit if the number of command-line arguments is incorrect, there is a problem opening the input file, or the data file contains invalid information. 
Anyone how to do this?
Read input file & display the average
===

Write a short complete Java program that reads the numbers in an input file and displays on
the console the average of those numbers. The program expects a single command-line parameter that is the name of a data file. A valid data file contains any number of doubles per line each separated by whitespace. Your program should display an appropriate error message then quit if the number of command-line arguments is incorrect, there is a problem opening the input file, or the data file contains invalid information. 
Anyone how to do this?