public class doubleNumber
{
public static void main (String[] args) {
double sum = 0;
int count = 0;
double userEnterNumber = 0;
double minimum = 0;
double maximum = 0;
double average = 0;
System.out.println(" Input numbers, type a non-numerical digit to exit: ");
Scanner in = new Scanner(System.in);
while ( in.hasNextDouble())
{
userEnterNumber = in.nextDouble();
if (userEnterNumber>0) {
sum = sum + userEnterNumber;
count ++;
average = sum/count;
if (userEnterNumber >maximum){
maximum = userEnterNumber;
}
else if (userEnterNumber <minimum){
minimum = userEnterNumber;
}
}
}
System.out.println(" Sum: "+sum);
System.out.println(" Count: "+count);
System.out.println(" Average: "+average);
System.out.println(" Maximum: "+maximum);
System.out.println(" Minimun: "+minimum);
}
}