-
Lenguaje
Pascal
-
Descripción
Permita seleccionar personal para un empleo de un total de N aspirantes. Los aspirantes deben cumplir las siguientes condiciones para ser aceptados:
- Mayores de edad.
- Ser ingeniero titulado.
- Tener experiencia laboral.
Al final el programa debe mostrar el total de aspirantes aceptados.
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
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
program AspirantesAceptados;
uses crt;
var anos_de_experiencia_laboral, aspirantes_aceptados, edad, es_ingeniero_titulado, i : integer;
var n : integer;
begin
aspirantes_aceptados := 0;
write ('Ingresa el valor de n: ');
readln (n);
for i:=1 to n do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de anos de experiencia laboral: ');
readln (anos_de_experiencia_laboral);
write ('Ingresa el valor de edad: ');
readln (edad);
writeln ('Selecciona el valor de es ingeniero titulado.');
writeln (' 1.- Si');
writeln (' 2.- No');
write (' : ');
repeat
readln (es_ingeniero_titulado);
if (es_ingeniero_titulado<1) or (es_ingeniero_titulado>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (es_ingeniero_titulado>=1) and (es_ingeniero_titulado<=2);
if (edad>=18) and (es_ingeniero_titulado=1) and (anos_de_experiencia_laboral>0) then
begin
writeln ('Aceptado');
aspirantes_aceptados := aspirantes_aceptados+1;
end
else
begin
writeln ('Rechazado');
end;
writeln;
end;
writeln ('Valor de aspirantes aceptados: ', aspirantes_aceptados);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var anos_de_experiencia_laboral, aspirantes_aceptados, edad, es_ingeniero_titulado, i : integer;
var n : integer;
begin
aspirantes_aceptados := 0;
write ('Ingresa el valor de n: ');
readln (n);
for i:=1 to n do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de anos de experiencia laboral: ');
readln (anos_de_experiencia_laboral);
write ('Ingresa el valor de edad: ');
readln (edad);
writeln ('Selecciona el valor de es ingeniero titulado.');
writeln (' 1.- Si');
writeln (' 2.- No');
write (' : ');
repeat
readln (es_ingeniero_titulado);
if (es_ingeniero_titulado<1) or (es_ingeniero_titulado>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (es_ingeniero_titulado>=1) and (es_ingeniero_titulado<=2);
if (edad>=18) and (es_ingeniero_titulado=1) and (anos_de_experiencia_laboral>0) then
begin
writeln ('Aceptado');
aspirantes_aceptados := aspirantes_aceptados+1;
end
else
begin
writeln ('Rechazado');
end;
writeln;
end;
writeln ('Valor de aspirantes aceptados: ', aspirantes_aceptados);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.