-
Lenguaje
Pascal
-
Descripción
Se introduce atraves del teclado el número de cedula y el total de ventas de un mes de un empleado se trata de calcular la comisión de acuerdo a las siguientes condiciones:
- Total de ventas menor a 100.000 la comisión es de 5%.
- Total de ventas entre 100.000 y 200.000 la comisión es de 10%.
- Total de ventas entre 200.000 y 300.000 la comisión es de 15%.
- Total de ventas entre 300.000 y 400.000 la comisión es de 20%.
- Total de ventas mayor a 400.000 la comisión es de 25%.
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
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
program ComisionDeLasVentasDeUnMes;
uses crt;
var comision, total_de_ventas : real;
var numero_de_cedula : string;
begin
write ('Ingresa el numero de cedula: ');
readln (numero_de_cedula);
write ('Ingresa el valor de total de ventas: ');
readln (total_de_ventas);
comision := 0;
if total_de_ventas<100000 then
begin
comision := total_de_ventas*0.05;
end;
if (total_de_ventas>=100000) and (total_de_ventas<200000) then
begin
comision := total_de_ventas*0.1;
end;
if (total_de_ventas>=200000) and (total_de_ventas<300000) then
begin
comision := total_de_ventas*0.15;
end;
if (total_de_ventas>=300000) and (total_de_ventas<400000) then
begin
comision := total_de_ventas*0.2;
end;
if total_de_ventas>=400000 then
begin
comision := total_de_ventas*0.25;
end;
writeln ('Numero de cedula: ', numero_de_cedula);
writeln ('Valor de comision: ', comision:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var comision, total_de_ventas : real;
var numero_de_cedula : string;
begin
write ('Ingresa el numero de cedula: ');
readln (numero_de_cedula);
write ('Ingresa el valor de total de ventas: ');
readln (total_de_ventas);
comision := 0;
if total_de_ventas<100000 then
begin
comision := total_de_ventas*0.05;
end;
if (total_de_ventas>=100000) and (total_de_ventas<200000) then
begin
comision := total_de_ventas*0.1;
end;
if (total_de_ventas>=200000) and (total_de_ventas<300000) then
begin
comision := total_de_ventas*0.15;
end;
if (total_de_ventas>=300000) and (total_de_ventas<400000) then
begin
comision := total_de_ventas*0.2;
end;
if total_de_ventas>=400000 then
begin
comision := total_de_ventas*0.25;
end;
writeln ('Numero de cedula: ', numero_de_cedula);
writeln ('Valor de comision: ', comision:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.