-
Lenguaje
Pascal
-
Descripción
Dados como datos la categoría y el sueldo de un trabajador, calcula el aumento correspondiente teniendo en cuenta la siguiente tabla.
Incrementos
Categoría | Aumento
1 | 15%
2 | 10%
3 | 8%
4 | 7%
Imprime la categoría del trabajador y el nuevo sueldo.
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
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
program AumentoPorCategoriaYSueldo;
uses crt;
var aumento, categoria, nuevo_sueldo, sueldo : real;
begin
write ('Ingresa el valor de categoria: ');
readln (categoria);
write ('Ingresa el valor de sueldo: ');
readln (sueldo);
aumento := 0;
if categoria=1 then
begin
aumento := sueldo*0.15;
end;
if categoria=2 then
begin
aumento := sueldo*0.10;
end;
if categoria=3 then
begin
aumento := sueldo*0.08;
end;
if categoria=4 then
begin
aumento := sueldo*0.07;
end;
nuevo_sueldo := sueldo+aumento;
writeln ('Valor de aumento: ', aumento:0:6);
writeln ('Valor de nuevo sueldo: ', nuevo_sueldo:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var aumento, categoria, nuevo_sueldo, sueldo : real;
begin
write ('Ingresa el valor de categoria: ');
readln (categoria);
write ('Ingresa el valor de sueldo: ');
readln (sueldo);
aumento := 0;
if categoria=1 then
begin
aumento := sueldo*0.15;
end;
if categoria=2 then
begin
aumento := sueldo*0.10;
end;
if categoria=3 then
begin
aumento := sueldo*0.08;
end;
if categoria=4 then
begin
aumento := sueldo*0.07;
end;
nuevo_sueldo := sueldo+aumento;
writeln ('Valor de aumento: ', aumento:0:6);
writeln ('Valor de nuevo sueldo: ', nuevo_sueldo:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.