-
Lenguaje
Pascal
-
Descripción
Se necesita un sistema para un supermecado, el cual dara un 10% de descuento a las personas que compren mas de $5000 en productos, por lo tanto al cliente se debe mostrar como resultado lo siguiente: el subtotal 1, descuento en el caso que existera, IVA (14%), subtotal 2 y 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
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 SistemaParaUnSupermecado;
uses crt;
var IVA, descuento, subtotal_1, subtotal_2, total_a_pagar : real;
begin
write ('Ingresa el valor de subtotal 1: ');
readln (subtotal_1);
if subtotal_1>5000 then
begin
descuento := subtotal_1*0.1;
end
else
begin
descuento := 0;
end;
subtotal_2 := subtotal_1-descuento;
IVA := subtotal_2*0.14;
total_a_pagar := subtotal_2+IVA;
writeln ('Valor de IVA: ', IVA:0:6);
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de subtotal 2: ', subtotal_2: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, descuento, subtotal_1, subtotal_2, total_a_pagar : real;
begin
write ('Ingresa el valor de subtotal 1: ');
readln (subtotal_1);
if subtotal_1>5000 then
begin
descuento := subtotal_1*0.1;
end
else
begin
descuento := 0;
end;
subtotal_2 := subtotal_1-descuento;
IVA := subtotal_2*0.14;
total_a_pagar := subtotal_2+IVA;
writeln ('Valor de IVA: ', IVA:0:6);
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de subtotal 2: ', subtotal_2:0:6);
writeln ('Valor de total a pagar: ', total_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.