-
Lenguaje
Pascal
-
Descripción
Un postulante a un empleo, realiza un test de capacitación, se obtuvo la siguiente información: cantidad total de preguntas que se le realizaron y la cantidad de preguntas que contestó correctamente. Se pide confeccionar un programa que ingrese los dos datos por teclado e informe el nivel del mismo según el porcentaje de respuestas correctas que ha obtenido, y sabiendo que:
- Nivel máximo: Porcentaje >= 90%.
- Nivel medio: Porcentaje >= 75% y < 90%.
- Nivel regular: Porcentaje >= 50% y < 75%.
- Fuera de nivel: Porcentaje < 50%.
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
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
program TestDeCapacitacion;
uses crt;
var porcentaje, preguntas_correctas, total_de_preguntas : real;
begin
write ('Ingresa el valor de preguntas correctas: ');
readln (preguntas_correctas);
write ('Ingresa el valor de total de preguntas: ');
readln (total_de_preguntas);
porcentaje := 100.0*preguntas_correctas/total_de_preguntas;
if porcentaje>=90 then
begin
writeln ('Nivel m'#160'ximo');
end;
if (porcentaje>=75) and (porcentaje<90) then
begin
writeln ('Nivel medio');
end;
if (porcentaje>=50) and (porcentaje<75) then
begin
writeln ('Nivel regular');
end;
if porcentaje<50 then
begin
writeln ('Fuera de nivel');
end;
writeln ('Valor de porcentaje: ', porcentaje:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var porcentaje, preguntas_correctas, total_de_preguntas : real;
begin
write ('Ingresa el valor de preguntas correctas: ');
readln (preguntas_correctas);
write ('Ingresa el valor de total de preguntas: ');
readln (total_de_preguntas);
porcentaje := 100.0*preguntas_correctas/total_de_preguntas;
if porcentaje>=90 then
begin
writeln ('Nivel m'#160'ximo');
end;
if (porcentaje>=75) and (porcentaje<90) then
begin
writeln ('Nivel medio');
end;
if (porcentaje>=50) and (porcentaje<75) then
begin
writeln ('Nivel regular');
end;
if porcentaje<50 then
begin
writeln ('Fuera de nivel');
end;
writeln ('Valor de porcentaje: ', porcentaje:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.