In Java Design a simple program that will prompt and get a series of integers from the user. The first
integer is special in that it indicates how many integers will follow. Once your program has
received all of the integers, compute and display the sum, the largest number entered, the
smallest number entered,and the average for all of the numbers entered.
import java.util.Scanner;
public class SeriesIntegers {
public static void main(String[] args) {
Scanner sc = new
Scanner(System.in);
int min = 0, max = 0, count = 0,
n;
double sum = 0;
boolean flag = true;
System.out.println("Enter integer
(-1 to quit): ");
while (true) {
n =
sc.nextInt();
if (n ==
-1)
break;
sum += n;
count++;
if (flag)
{
flag = false;
min = n;
max = n;
continue;
}
if (n >
max)
max = n;
if (n <
min)
min = n;
}
System.out.println("Sum of
elements: " + sum);
System.out.println("Average of
elements: " + (sum / count));
System.out.println("Largest
element: " + max);
System.out.println("Smallest
element: " + min);
}
}

Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me
In Java Design a simple program that will prompt and get a series of integers from...