import java.util.Scanner; //For console input public class ArrayDemo { public void doTheThing() { double[] values; //Array of readings; not yet sized! int numValues; //This will define the size of the array Scanner input=new Scanner(System.in); System.out.print("How many values would you like? "); numValues=input.nextInt(); values=new double[numValues]; //Allocating the array! //Let's split out populating the array enterValues(values,input); //Now let's display them! displayValues(values); //And now, the average! double sum=values[0]; for ( int i=1; i "); values[i]=in.nextDouble(); } } private void displayValues( double[] arr ) { //Note that we neither have, nor need, numValues here for ( int i=0; i