0
I need to receive 30 bills and return the number of approvals, reprobations and the average of the room. I tried the following:
public class notas {
public static int aprovacoes;
public static int reprovacoes;
public static int recs;
public static double total;
public static void main(String []args){
double notas[] = new double [30];
Scanner input = new Scanner(System.in);
System.out.print("Digite todas as notas: ");
for(int i = 0; i < notas.length; i++){
notas[i] = input.nextDouble();
}
System.out.println("numero de aprovados: "+aprovacoes);
System.out.println("numero de reprovados: "+reprovacoes);
System.out.println("numero de recs: "+recs);
System.out.println("media da sala: "+(total/30));
}
public static void resultadoSala(double [] notas){
for(int i = 0; i < notas.length; i++){
if(notas[i] >= 5){
aprovacoes++;
}
else if(notas[i] <= 3){
reprovacoes++;
}
else{
recs++;
}
}
}
public static double mediaSala(double []notas){
for(int i = 0; i < notas.length; i++){
total += notas[i];
}
return total;
}
}
However, after compiling the code and inserting the notes, all outputs were zero. What I must do?