-
Lenguaje
Pascal
-
Descripción
María compró 3 productos, donde tiene que aumentar el 16% de IVA al total de la compra, muestra el subtotal, cuanto va a pagar de IVA 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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
program CompraDeMaria;
uses crt;
var IVA, precio_del_producto_1, precio_del_producto_2, precio_del_producto_3, subtotal : real;
var total_a_pagar : real;
begin
write ('Ingresa el valor de precio del producto 1: ');
readln (precio_del_producto_1);
write ('Ingresa el valor de precio del producto 2: ');
readln (precio_del_producto_2);
write ('Ingresa el valor de precio del producto 3: ');
readln (precio_del_producto_3);
subtotal := precio_del_producto_1+precio_del_producto_2+precio_del_producto_3;
IVA := subtotal*0.16;
total_a_pagar := subtotal+IVA;
writeln ('Valor de IVA: ', IVA:0:6);
writeln ('Valor de subtotal: ', subtotal:0:6);
writeln ('Valor de total a pagar: ', total_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var IVA, precio_del_producto_1, precio_del_producto_2, precio_del_producto_3, subtotal : real;
var total_a_pagar : real;
begin
write ('Ingresa el valor de precio del producto 1: ');
readln (precio_del_producto_1);
write ('Ingresa el valor de precio del producto 2: ');
readln (precio_del_producto_2);
write ('Ingresa el valor de precio del producto 3: ');
readln (precio_del_producto_3);
subtotal := precio_del_producto_1+precio_del_producto_2+precio_del_producto_3;
IVA := subtotal*0.16;
total_a_pagar := subtotal+IVA;
writeln ('Valor de IVA: ', IVA:0:6);
writeln ('Valor de subtotal: ', subtotal:0:6);
writeln ('Valor de total a pagar: ', total_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.