This is part of a larger assignment. Here, I basically need to accept user input until the user types 0. These doubles need to be added to an array. For some reason, they aren't being added to the array right now. Any help?
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
double[] inputArray = new double[3];
double input;
do{
input = scanner.nextDouble();
for(int i = 0; i < 3; i++){
inputArray[i] = input;
}
}
while(input != 0);
System.out.println("Element 0:" + inputArray[0]);
System.out.println("Element 1:" + inputArray[1]);
}