Answer:
see explaination 
Step-by-step explanation:
import java.util.Scanner;
public class NumbersStats {
 public static void main(String[] args) {
 Scanner in = new Scanner(System.in);
 int pos = 0, neg = 0, count = 0, num;
 double total = 0;
 System.out.print("Enter an integer, the input ends if it is 0: ");
 while (true) {
 num = in.nextInt();
 if(num == 0) break;
 if(num > 0) {
 pos++;
 } else {
 neg++;
 }
 total += num;
 count++;
 }
 System.out.println("The number of positives is " + pos);
 System.out.println("The number of negatives is " + neg);
 System.out.println("The total is " + total);
 System.out.println("The average is " + (total/count));
 }
}