I'm giving it and I can not find how to find the number of students with grades above average.
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n, cont = 0;
double acum = 0, p_est, p_gen = 0;
//IN
System.out.println("Ingrese numero de estudiantes ");
n = sc.nextInt();
//PROCESS
for (int i = 1; i <= n; i++) {
System.out.println("Ingrese promedio del estudiante " + i + " : ");
p_est = sc.nextDouble();
acum = acum + p_est;
p_gen = acum / n;
if (p_est > p_gen) {
cont++;
}
}
System.out.println("El promedio general es: " + p_gen);
System.out.print("Estudiantes superiores: " + cont);
System.out.println("");
}
}