• Lenguaje

    Pascal

  • Descripción

    Dada la C.I., nombre, y la nota definitiva de 30 estudiantes, realice un algoritmo que permita calcular y dar como salida lo siguiente:
    - Cantidad de alumnos aprobados.
    - Cantidad de alumnos reprobados.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
program NotaDefinitivaDe30Estudiantes;
uses crt;

var aprobados, i, reprobados : integer;
var calificacion_aprobatoria, nota_definitiva : real;
var CI, nombre : string;
begin
    aprobados := 0;
    reprobados := 0;
    write ('Ingresa el valor de calificacion aprobatoria: ');
    readln (calificacion_aprobatoria);
    for i:=1 to 30 do
    begin
        writeln ('PROCESO ', i);
        write ('Ingresa el CI: ');
        readln (CI);
        write ('Ingresa el nombre: ');
        readln (nombre);
        write ('Ingresa el valor de nota definitiva: ');
        readln (nota_definitiva);
        if nota_definitiva<calificacion_aprobatoria then
            begin
                reprobados := reprobados+1;
            end
        else
            begin
                aprobados := aprobados+1;
            end;
        writeln ('CI: ', CI);
        writeln ('Nombre: ', nombre);
        writeln;
    end;
    writeln ('Valor de aprobados: ', aprobados);
    writeln ('Valor de reprobados: ', reprobados);
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.