Can anyone tell if I am on the right track with this one please?
package com.codegym.task.task05.task0507;
import java.util.*;
/*
Arithmetic mean
*/
public class Solution {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int sum = 0;
int num = 0;
double mean = 0.0;
int count = 0;
for(int i = 0; i < count ; i++){
num = sc.nextInt();
count = count + 1;
sum = sum + num;
}
while (true) {
num = sc.nextInt();
if (num < 0)
break;
}
mean = sum/count;
System.out.println(mean);
}
}