• Lenguaje

    Pascal

  • Descripción

    Para ser admitidos en un Club los candidatos deben aprobar un test de inteligencia (cuyo puntaje es entre 1 y 100) con un puntaje de 75 puntos como mínimo. Los nombres de los candidatos y los resultados son ingresados. Elabore un programa que procese la información y determine lo siguiente:
    a) Cuántos candidatos aprobaron el test.
    b) Porcentaje de candidatos que no aprobaron el test.
    c) Cuál fue el mayor puntaje.
    d) Cuál fue el menor puntaje.
    e) Cuántos candidatos aprobaron con un puntaje entre 85 y 100 puntos.

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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
program AdmisionAUnClub;
uses crt;

var aprobados, candidatos, entre_85_y_100, mayor_puntaje, menor_puntaje : integer;
var puntaje : integer;
var porcentaje_reprobados : real;
var tecla_repetir : char;
begin
    aprobados := 0;
    candidatos := 0;
    entre_85_y_100 := 0;
    mayor_puntaje := 0;
    menor_puntaje := 0;
    porcentaje_reprobados := 0;
    repeat
        clrscr;
        write ('Ingresa el valor de puntaje: ');
        readln (puntaje);
        candidatos := candidatos+1;
        if puntaje>=75 then
            begin
                aprobados := aprobados+1;
            end;
        if (candidatos=1) or (mayor_puntaje<puntaje) then
            begin
                mayor_puntaje := puntaje;
            end;
        if (candidatos=1) or (menor_puntaje>puntaje) then
            begin
                menor_puntaje := puntaje;
            end;
        if (puntaje>=85) and (puntaje<=100) then
            begin
                entre_85_y_100 := entre_85_y_100+1;
            end;
        writeln;
        write (#168'Deseas repetir el proceso? (S/N): ');
        repeat
            tecla_repetir := readkey;
        until (tecla_repetir = 's') or (tecla_repetir = 'n') or (tecla_repetir = 'S') or (tecla_repetir = 'N');
    until (tecla_repetir <> 's') and (tecla_repetir <> 'S');
    if candidatos = 0 then
        porcentaje_reprobados := 0
    else
        porcentaje_reprobados := 100.0*(candidatos-aprobados)/candidatos;
    writeln ('Valor de aprobados: ', aprobados);
    writeln ('Valor de candidatos: ', candidatos);
    writeln ('Valor de entre 85 y 100: ', entre_85_y_100);
    writeln ('Valor de mayor puntaje: ', mayor_puntaje);
    writeln ('Valor de menor puntaje: ', menor_puntaje);
    writeln ('Valor de porcentaje reprobados: ', porcentaje_reprobados:0:6);
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.