Esta es una pregunta de programación sobre Java. Espero que puedan ayudarme. Puedo ingresar las calificaciones de los estudiantes desde el teclado y luego contar la distribución de las calificaciones de los estudiantes.
importar java.util.Scanner;
Estadísticas de clase pública {
privado estático int stuScore = 0;
privado estático int cntFor0and9 = 0;
int estático privado cntFor10and19 = 0;
int estático privado cntFor20and29 = 0;
int estático privado cntFor30and39 = 0;
estático privado int cntFor40and49 = 0;
estático privado int cntFor50and59 = 0;
estático privado int cntFor60and69 = 0;
estático privado int cntFor80and89 = 0;
estático privado int cntFor90and99 = 0
estático privado intFor100 = 0; public static void main(String[] args) {
System.out.println("Ingrese las puntuaciones de los estudiantes");
Scanner scanner = new Scanner(System.in);
stuScore = scanner.nextInt();
while (stuScore > 0) {
calculador();
stuScore = scanner.nextInt() ;
}
print();
}
calculador de vacío estático público() {
if (stuScore < 10) {
cntFor0and9++;
} más si (stuScore < 20) {
cntFor10and19++;
} más si (stuScore < 30) {
cntFor20and29++;
} más si (stuScore < 40) {
cntFor30and39++;
} más si (stuScore < 50) {
cntFor40and49++;
} más si (stuScore < 60) {
cntFor50and59++;
} más if ( stuScore < 70) {
cntFor60and69++;
} else if ( stuScore < 80) {
cntFor70and79++;
} else si (stuScore < 90) {
cntFor80and89++;
} más si (stuScore < 100)
{
cntFor90and99++;
} else if (stuScore == 100) {
cntFor1;
}
p>}
public static void print() {
System.out.print("0 ~ 9 puntuaciones allí");
para (int i = 1; i <= cntFor0and9; i++) {
System.print("30 ~ 39 puntos allí");
for ( int i = 1; i < = cntFor30and39; i++) {
System.out.print("*");
}
System.out.println();
System.out.print("40 ~ 49 puntos son");
for (int i = 1; i <= cntFor40and49; i++) {
System . out.print("*");
}
System.out.print("40 ~ 49 puntos son")println();
p > System.out.print("Hay 60 ~ 69 puntos disponibles");
for (int i = 1; i <= cntFor60and69; i++) {
System.out . print("*");
}
System.out.println();
System.out.print("70 ~ 79 puntos allí " );
for (int i = 1; i <= cntFor70and79; i++) {
System.out.print("*");
}
System.out.print("*");
}
System.out.println();
System.out.print ( "90 ~ 99 puntos");
for (int i = 1; i <= cntFor90and99; i++) {
System.if (int i = 1; i <= cntFor100 ; i++) {
System.out.print("*");
}
System.out.print("100 puntos allí");
for (int i = 1; i <= cntFor100; i++) {
System.out.print("*");
}< / p>
System.out.print("100 puntos ahí");
}
}
}