-
Lenguaje
Pascal
-
Descripción
Dado como datos la categoría, el tiempo de servicio y el sueldo de un colaborador determine su nueva remuneración considerando el aumento correspondiente según la siguiente tabla:
Categoría | Tiempo de servicio Aumento
Funcionario | Menor o igual a 5 años 10% - Mayor a 5 años 25%
Empleado | Menor o igual a 10 años 8% - Mayor a 10 años 15%
Obrero | Menor o igual a 10 años 5% - Mayor a 10 años 12%
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
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
program AumentoPorCategoriaYTiempoDeServicio;
uses crt;
var categoria : integer;
var aumento, nueva_remuneracion, sueldo, tiempo_de_servicio : real;
begin
write ('Ingresa el valor de sueldo: ');
readln (sueldo);
write ('Ingresa el valor de tiempo de servicio: ');
readln (tiempo_de_servicio);
writeln ('Selecciona el valor de categoria.');
writeln (' 1.- Funcionario');
writeln (' 2.- Empleado');
writeln (' 3.- Obrero');
write (' : ');
repeat
readln (categoria);
if (categoria<1) or (categoria>3) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (categoria>=1) and (categoria<=3);
aumento := 0;
if (categoria=1) and (tiempo_de_servicio<=5) then
begin
aumento := sueldo*0.1;
end;
if (categoria=1) and (tiempo_de_servicio>5) then
begin
aumento := sueldo*0.25;
end;
if (categoria=2) and (tiempo_de_servicio<=10) then
begin
aumento := sueldo*0.08;
end;
if (categoria=2) and (tiempo_de_servicio>10) then
begin
aumento := sueldo*0.15;
end;
if (categoria=3) and (tiempo_de_servicio<=10) then
begin
aumento := sueldo*0.05;
end;
if (categoria=3) and (tiempo_de_servicio>10) then
begin
aumento := sueldo*0.12;
end;
nueva_remuneracion := sueldo+aumento;
writeln ('Valor de aumento: ', aumento:0:6);
writeln ('Valor de nueva remuneracion: ', nueva_remuneracion:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var categoria : integer;
var aumento, nueva_remuneracion, sueldo, tiempo_de_servicio : real;
begin
write ('Ingresa el valor de sueldo: ');
readln (sueldo);
write ('Ingresa el valor de tiempo de servicio: ');
readln (tiempo_de_servicio);
writeln ('Selecciona el valor de categoria.');
writeln (' 1.- Funcionario');
writeln (' 2.- Empleado');
writeln (' 3.- Obrero');
write (' : ');
repeat
readln (categoria);
if (categoria<1) or (categoria>3) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (categoria>=1) and (categoria<=3);
aumento := 0;
if (categoria=1) and (tiempo_de_servicio<=5) then
begin
aumento := sueldo*0.1;
end;
if (categoria=1) and (tiempo_de_servicio>5) then
begin
aumento := sueldo*0.25;
end;
if (categoria=2) and (tiempo_de_servicio<=10) then
begin
aumento := sueldo*0.08;
end;
if (categoria=2) and (tiempo_de_servicio>10) then
begin
aumento := sueldo*0.15;
end;
if (categoria=3) and (tiempo_de_servicio<=10) then
begin
aumento := sueldo*0.05;
end;
if (categoria=3) and (tiempo_de_servicio>10) then
begin
aumento := sueldo*0.12;
end;
nueva_remuneracion := sueldo+aumento;
writeln ('Valor de aumento: ', aumento:0:6);
writeln ('Valor de nueva remuneracion: ', nueva_remuneracion:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.