import java.io.*;
import java.util.*;
public class Exc03
{
	public static void main(String[ ] args)
		{
		     int numItems = 0;
             int x = 0;
             double [ ]price = new double [200];  //200 is an educated guess, but must
												  //be large enough to handle any 
												  //possibility.
		     try   
			   {
				File filename = new File("nameOfFile.data");  
				Scanner inFile = new Scanner(filename);
				while(true)    // infinite loop ends when there is an exception.
					{
				                   price[x] = inFile.nextDouble( );  // read one item and 
				   //point to the next one.
					      x ++;  // add one so there is a new index.
					}
			   }
		    catch (Exception e)  // When there are no more items in file.
				{
					numItems = x;  //Count of how many items.
				}
		}

}