-
Lenguaje
Pascal
-
Descripción
En un poblado de USA solo dejan trabajar a hombres mayores de 25 años y a las mujeres de 20 años. Si tienen más de 50 años les dan una compensación mensual de 100 dólares extras. Los sueldos varían debido a la discriminación racial según se indica.
- Gente de color 200 dólares mensuales
- Asiáticos 400 dólares mensuales
- Latinos 600 dólares mensuales
- Norteamericanos 800 dólares mensuales
El sexo no tiene que ver con los salarios. Elabore un programa para saber si se contrata a una persona y cual será su salario mensual.
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
55
56
57
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
55
56
57
program SueldoPorGrupoRacial;
uses crt;
var edad, grupo_racial, salario_mensual, sexo : integer;
begin
write ('Ingresa el valor de edad: ');
readln (edad);
writeln ('Selecciona el valor de grupo racial.');
writeln (' 1.- Gente de color');
writeln (' 2.- Asi'#160'ticos');
writeln (' 3.- Latinos');
writeln (' 4.- Norteamericanos');
write (' : ');
repeat
readln (grupo_racial);
if (grupo_racial<1) or (grupo_racial>4) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (grupo_racial>=1) and (grupo_racial<=4);
writeln ('Selecciona el valor de sexo.');
writeln (' 1.- hombre');
writeln (' 2.- mujer');
write (' : ');
repeat
readln (sexo);
if (sexo<1) or (sexo>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (sexo>=1) and (sexo<=2);
salario_mensual := 0;
if ((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20)) then
begin
writeln ('Si se contrata');
end
else
begin
writeln ('No se contrata');
end;
if (((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20))) and (grupo_racial=1) then
begin
salario_mensual := 200;
end;
if (((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20))) and (grupo_racial=2) then
begin
salario_mensual := 400;
end;
if (((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20))) and (grupo_racial=3) then
begin
salario_mensual := 600;
end;
if (((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20))) and (grupo_racial=4) then
begin
salario_mensual := 800;
end;
writeln ('Valor de salario mensual: ', salario_mensual);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var edad, grupo_racial, salario_mensual, sexo : integer;
begin
write ('Ingresa el valor de edad: ');
readln (edad);
writeln ('Selecciona el valor de grupo racial.');
writeln (' 1.- Gente de color');
writeln (' 2.- Asi'#160'ticos');
writeln (' 3.- Latinos');
writeln (' 4.- Norteamericanos');
write (' : ');
repeat
readln (grupo_racial);
if (grupo_racial<1) or (grupo_racial>4) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (grupo_racial>=1) and (grupo_racial<=4);
writeln ('Selecciona el valor de sexo.');
writeln (' 1.- hombre');
writeln (' 2.- mujer');
write (' : ');
repeat
readln (sexo);
if (sexo<1) or (sexo>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (sexo>=1) and (sexo<=2);
salario_mensual := 0;
if ((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20)) then
begin
writeln ('Si se contrata');
end
else
begin
writeln ('No se contrata');
end;
if (((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20))) and (grupo_racial=1) then
begin
salario_mensual := 200;
end;
if (((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20))) and (grupo_racial=2) then
begin
salario_mensual := 400;
end;
if (((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20))) and (grupo_racial=3) then
begin
salario_mensual := 600;
end;
if (((sexo=1) and (edad>25)) or ((sexo=2) and (edad>20))) and (grupo_racial=4) then
begin
salario_mensual := 800;
end;
writeln ('Valor de salario mensual: ', salario_mensual);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.