-
Lenguaje
Pascal
-
Descripción
Solicite el sueldo y los años de antigüedad de varios trabajadores. El programa debe informar:
a) Si el sueldo es inferior a 450 000 y su antigüedad es igual o superior a 10 años, otorgarle un aumento del 20 %, mostrar el sueldo con el aumento a pagar.
b) Si el sueldo es inferior a 450 000 pero su antigüedad es menor a 10 años, otorgarle un aumento de 5 %, mostrar el sueldo con el aumento a pagar.
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 AumentoPorSueldoYAntiguedad;
uses crt;
var antiguedad, aumento, sueldo, sueldo_a_pagar : real;
var tecla_repetir : char;
begin
repeat
clrscr;
write ('Ingresa el valor de antiguedad: ');
readln (antiguedad);
write ('Ingresa el valor de sueldo: ');
readln (sueldo);
aumento := 0;
if (sueldo<450000) and (antiguedad>=10) then
begin
aumento := sueldo*0.20;
end;
if (sueldo<450000) and (antiguedad<10) then
begin
aumento := sueldo*0.05;
end;
sueldo_a_pagar := sueldo+aumento;
writeln ('Valor de aumento: ', aumento:0:6);
writeln ('Valor de sueldo a pagar: ', sueldo_a_pagar:0:6);
writeln;
write (#168'Deseas repetir el proceso? (S/N): ');
repeat
tecla_repetir := readkey;
until (tecla_repetir = 's') or (tecla_repetir = 'n') or (tecla_repetir = 'S') or (tecla_repetir = 'N');
until (tecla_repetir <> 's') and (tecla_repetir <> 'S');
end.
uses crt;
var antiguedad, aumento, sueldo, sueldo_a_pagar : real;
var tecla_repetir : char;
begin
repeat
clrscr;
write ('Ingresa el valor de antiguedad: ');
readln (antiguedad);
write ('Ingresa el valor de sueldo: ');
readln (sueldo);
aumento := 0;
if (sueldo<450000) and (antiguedad>=10) then
begin
aumento := sueldo*0.20;
end;
if (sueldo<450000) and (antiguedad<10) then
begin
aumento := sueldo*0.05;
end;
sueldo_a_pagar := sueldo+aumento;
writeln ('Valor de aumento: ', aumento:0:6);
writeln ('Valor de sueldo a pagar: ', sueldo_a_pagar:0:6);
writeln;
write (#168'Deseas repetir el proceso? (S/N): ');
repeat
tecla_repetir := readkey;
until (tecla_repetir = 's') or (tecla_repetir = 'n') or (tecla_repetir = 'S') or (tecla_repetir = 'N');
until (tecla_repetir <> 's') and (tecla_repetir <> 'S');
end.