I've looked through a lot of the other problems people have been having, and written and re written the code a few times just to get a fresh start after a new perspective. I thought this time I was correct. Lo and behold I am missing a piece of the puzzle.
Thanks all you're a beautiful bunch
package com.codegym.task.task05.task0507;
/*
Arithmetic mean
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int numcount = 0;
int numsum = 0;
while (true) {
int a = Integer.parseInt(br.readLine());
if (a == -1){
break;
}
numcount++;
numsum += a;
}
double mean = numsum / numcount;
System.out.println(mean);
}
}