Intro to Java Classwork: Mean Calculator, Part 2
Copy the code from your previous program ("MeanCalculatorPart1.java")
into a new file named "MeanCalculatorPart2.java".  Then, make the
following modifications to your code in your new file:

  1) Instead of getting just five decimal numbers from the user,
     allow the user to enter an unlimited amount of numbers.  The
     user should still press the ENTER key after each entry, but
     should press the ENTER key on a line by itself (with no
     number) to indicate that he/she is done entering numbers.

  2) Instead of using a 'for' loop to get the numbers from the user,
     use a 'while' loop to perform this task.  You will need to
     get each number as a string, and then convert it to a double.

As was the case with your previous program, this program will need
two methods in addition to 'main'.  One method will get the numbers
from the user, and the other will compute and display the mean.

Once again, your program does not need to perform any error trapping.
That is, you may assume that the user will enter only decimal numbers
(no strings).  And, as before, besides the 'Scanner' class, you may
not import or use any external methods.  However, you may use global
variables in your program.  The output of your program should be neat,
organized, and easy to understand.


As always, all of your code must be your own, written entirely and
only by you within your online CodeHS.com account.  You must never
copy/paste, receive, view, or in any way use code that was created
or modified by another person, entity, or artificial intelligence.


Advanced Option #1
In addition to computing the average of the user's numbers, also
compute and display the median of the numbers.  The median is the
middle number (or numbers) when the list of numbers is sorted in
numerical order.  If the user enters an odd amount of numbers, then
the median is just the single middle number once the user's numbers
have been sorted.  If the user enters an even amount of numbers,
then the median is the average of the two middle numbers once the
list of numbers has been sorted.

Advanced Option #2
In addition to computing the average of the user's numbers, also
find and display the mode (or modes), if any exist, in the set of
numbers entered by the user.  The mode of a list of numbers is
the number that occurs most often (more than any of the other
numbers in the list).  There can be multiple modes in a list of
numbers if two or more numbers occur the same number of times, and
more than all of the other numbers in the list.  If every number
in the list occurs exactly one time, then the list has no modes.
This option may be completed along with, or instead of, the first
advanced option.