• Lenguaje

    Pascal

  • Descripción

    Ingresar el precio y la cantidad para dos productos. Mostrar el importe por cada producto, el subtotal de los importes, el IGV (18%), el descuento (5%) y el total 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
program DescuentoEIgvDe2Productos;
uses crt;

var IGV, costpo_producto_A, costpo_producto_B, descuento, importe_producto_A : real;
var importe_producto_B, precio_producto_A, precio_producto_B, subtotal, total : real;
begin
    write ('Ingresa el valor de costpo producto A: ');
    readln (costpo_producto_A);
    write ('Ingresa el valor de costpo producto B: ');
    readln (costpo_producto_B);
    write ('Ingresa el valor de precio producto A: ');
    readln (precio_producto_A);
    write ('Ingresa el valor de precio producto B: ');
    readln (precio_producto_B);
    importe_producto_A := costpo_producto_A*precio_producto_A;
    importe_producto_B := costpo_producto_B*precio_producto_B;
    subtotal := importe_producto_A+importe_producto_B;
    descuento := subtotal*0.05;
    IGV := (subtotal-descuento)*0.18;
    total := subtotal-descuento+IGV;
    writeln ('Valor de IGV: ', IGV:0:6);
    writeln ('Valor de descuento: ', descuento:0:6);
    writeln ('Valor de importe producto A: ', importe_producto_A:0:6);
    writeln ('Valor de importe producto B: ', importe_producto_B:0:6);
    writeln ('Valor de subtotal: ', subtotal:0:6);
    writeln ('Valor de total: ', total:0:6);
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.