Thanks for everyone's input. This was my first time posting on a programming forum.
So, it looks like in order to alert the scanner that the user is done inputting there must be some kind of signal (a non integer input).
For example adding a
boolean done = false;
while (!done)
{
...
}
I guess I was trying to avoid making the user input anything other than their numbers because this was the original question:
Write a program that prompts the user to a list of numbers, all on one line. If the list is empty, the program prints “No average”. Otherwise, the program then computes and prints the average of those numbers.
Sample run, with user input underlined:
Enter numbers: 10.5 7 -2.4
Average: 5.033333333333333
Write only one program class named Average with only a main method. Import any required class(es).