// Page 126 import java.util.Scanner; public class Prog_10_3 { public static void main(String[] args) { int length; length=getData(); System.out.println("The array length is: " + length); } private static int getData() { Scanner input=new Scanner(System.in); int length = 0; // # of data in the file while (input.hasNext()) { double[] myArr=new double[length+1]; myArr[length] = input.nextDouble(); length ++; } return length; } }