-
Lenguaje
Pascal
-
Descripción
Se ingresa por teclado una cierta cantidad de producto y el precio por unidad del producto. Calcular el importe, luego hacer un descuento de 10% si el importe es mayor o igual a S/. 100,00 caso contrario hacer el descuento de 5%, luego calcular el descuento y el importe final 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
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
program DescuentoPorImporte;
uses crt;
var cantidad_de_producto, descuento, importe, importe_final_a_pagar, precio_por_unidad : real;
begin
write ('Ingresa el valor de cantidad de producto: ');
readln (cantidad_de_producto);
write ('Ingresa el valor de precio por unidad: ');
readln (precio_por_unidad);
importe := cantidad_de_producto*precio_por_unidad;
if importe>100 then
begin
descuento := importe*0.1;
end
else
begin
descuento := importe*0.05;
end;
importe_final_a_pagar := importe-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de importe: ', importe:0:6);
writeln ('Valor de importe final a pagar: ', importe_final_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var cantidad_de_producto, descuento, importe, importe_final_a_pagar, precio_por_unidad : real;
begin
write ('Ingresa el valor de cantidad de producto: ');
readln (cantidad_de_producto);
write ('Ingresa el valor de precio por unidad: ');
readln (precio_por_unidad);
importe := cantidad_de_producto*precio_por_unidad;
if importe>100 then
begin
descuento := importe*0.1;
end
else
begin
descuento := importe*0.05;
end;
importe_final_a_pagar := importe-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de importe: ', importe:0:6);
writeln ('Valor de importe final a pagar: ', importe_final_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.