miércoles, 20 de marzo de 2019

Leer las notas de una clase de informática y deducir todas aquellas que son NOTABLES (>= 7 y < 9).


Inicio
entero numero_estudiantes nota contador=0

Mostrar ”digite numero de estudiantes”
leer numero_estudiantes

Mostrar “ notas de 0 – 10 “
Para i = 1 i < numero_estudiante i++

Mostrar “ ingrese nota “ +i
leer nota


Si nota >07 & nota <= 9 hacer
Mostrar “ nota notable”

fin si
si no
Mostrar “ no es notable”}
Fin si no
fin para
mostrar “ total notables: “ + contador
fin


Java

public static void main(String[] args) {
int numero_estudiante, nota, contador = 0;
Scanner leer = new Scanner(System.in);
System.out.print("Digite numero de estudiantes: ");
numero_estudiante = leer.nextInt();
System.out.println("Notas de 0 - 10 ");
for (int i = 1; i <= numero_estudiante; i++) {
System.out.print("Ingrese nota: " + i + ":");
nota = leer.nextInt();
if ((nota >= 7) && (nota <= 9)) {
System.out.println("Nota notable");
contador = contador++;
} else {
System.out.println("No es notable");
}
}
System.out.print("Total notables: " + contador);
}
}



No hay comentarios:

Publicar un comentario