-
Lenguaje
Pascal
-
Descripción
Leer el monto de ventas de ciertos productos. Aplicar el descuento al cliente considerando la siguiente tabla:
Monto de venta | Descuento
0 - 500 | 0%
500 - 1500 | 5%
1500 - 5000 | 12%
5000 > | 18%
Calcular el monto total que el cliente pagara.
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
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
program DescuentoAlCliente;
uses crt;
var descuento, monto_de_venta, monto_total : real;
begin
write ('Ingresa el valor de monto de venta: ');
readln (monto_de_venta);
descuento := 0;
if (monto_de_venta>=500) and (monto_de_venta<1500) then
begin
descuento := descuento*0.05;
end;
if (monto_de_venta>=1500) and (monto_de_venta<5000) then
begin
descuento := descuento*0.12;
end;
if monto_de_venta>=5000 then
begin
descuento := descuento*0.18;
end;
monto_total := monto_de_venta-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de monto total: ', monto_total:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var descuento, monto_de_venta, monto_total : real;
begin
write ('Ingresa el valor de monto de venta: ');
readln (monto_de_venta);
descuento := 0;
if (monto_de_venta>=500) and (monto_de_venta<1500) then
begin
descuento := descuento*0.05;
end;
if (monto_de_venta>=1500) and (monto_de_venta<5000) then
begin
descuento := descuento*0.12;
end;
if monto_de_venta>=5000 then
begin
descuento := descuento*0.18;
end;
monto_total := monto_de_venta-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de monto total: ', monto_total:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.