title: How to have multiple inputs on one line,all being passed into a method with variable arguments
body: <p>Alright,so I've got this assignment that requires me to have a method with a variable number of inputs as well as a string input. The inputs all have to be on one line in the scanner, and the method has to return the number of values entered,the average value,the max value,the min value,and the string that was entered. </p>
  
  <p>This is an example of that the terminal window should look like.</p>
  
  <pre><code>Please enter the name of the course: CourseNameHere
  Please enter the scores for CSC 201 on a single line and type a -1 at the end
  71 02 81 44 84 17 38 11 20 05 93 -1
  
  The course name     : CourseNameHere
  Number of Scores    : 11
  The Average Score   : 42.37
  The Minimum Score   : 02
  The Maximum Score   : 93
  </code></pre>
  
  <p>The Average score has to be rounded to 2 decimal places(which I think I can handle)
  The only problem for me is getting the variable number of inputs to be scanned on a single line,and how to have the program count the number of inputs if I'm not hitting enter between the inputs.
  This is what I have so far.but I have no idea where to go from here. I can get it to ask for sequential values,but they aren't all on the same line</p>
  
  <pre><code>public static int calculate(int again)
  {
  Scanner input = new Scanner(System.in);
  int numberOfValues = 0;
  int max = -9999;
  int min =  100000;
  int sum = 0;
  double value;
  
  System.out.print("What is the name of the course you wish to evaluate? : ");
  String courseName = input.next();
  System.out.println("Please enter the scores for the class, press enter between each value." + "\n" + "Enter -1 to finish and calculate.");
  for(value = 0; value != 1; numberOfValues++)
          {
              value = input.nextDouble();
              sum += value;
  
  
  
  
  
          }
  </code></pre>