• Lenguaje

    Pascal

  • Descripción

    Leer un monto a pagar y aplicar un descuento de 4% y luego el 18% de IGV.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
program DescuentoEIgv;
uses crt;

var IGV, descuento, monto_a_pagar, subtotal, total : real;
begin
    write ('Ingresa el valor de monto a pagar: ');
    readln (monto_a_pagar);
    descuento := monto_a_pagar*0.04;
    subtotal := monto_a_pagar-descuento;
    IGV := subtotal*0.18;
    total := subtotal+IGV;
    writeln ('Valor de IGV: ', IGV:0:6);
    writeln ('Valor de descuento: ', descuento: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.