-
Lenguaje
Pascal
-
Descripción
Lea el precio de 10 artículos que se compran en una tienda. Calcule la cantidad total de los precios de los artículos.
- Si la sumatoria es menor a Bs 5,000 realice un descuento de 15%.
- Si la sumatoria está entre Bs 5,000 y 10,000 el descuento será de 20%.
- Si es mayor a Bs 10000 el descuento será de 25%.
En cualquiera de los casos el programa deberá mostrar por pantalla el total de la sumatoria, el monto del descuento y el precio total a pagar por el vendedor.
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
program DescuentoPor10Articulos;
uses crt;
var articulo_01, articulo_02, articulo_03, articulo_04, articulo_05 : real;
var articulo_06, articulo_07, articulo_08, articulo_09, articulo_10 : real;
var descuento, sumatoria, total_a_pagar : real;
begin
write ('Ingresa el valor de articulo 01: ');
readln (articulo_01);
write ('Ingresa el valor de articulo 02: ');
readln (articulo_02);
write ('Ingresa el valor de articulo 03: ');
readln (articulo_03);
write ('Ingresa el valor de articulo 04: ');
readln (articulo_04);
write ('Ingresa el valor de articulo 05: ');
readln (articulo_05);
write ('Ingresa el valor de articulo 06: ');
readln (articulo_06);
write ('Ingresa el valor de articulo 07: ');
readln (articulo_07);
write ('Ingresa el valor de articulo 08: ');
readln (articulo_08);
write ('Ingresa el valor de articulo 09: ');
readln (articulo_09);
write ('Ingresa el valor de articulo 10: ');
readln (articulo_10);
sumatoria := articulo_01+articulo_02+articulo_03+articulo_04+articulo_05+articulo_06+articulo_07+articulo_08+articulo_09+articulo_10;
descuento := 0;
if sumatoria<5000 then
begin
descuento := sumatoria*0.15;
end;
if (sumatoria>=5000) and (sumatoria<=10000) then
begin
descuento := sumatoria*0.20;
end;
if sumatoria>10000 then
begin
descuento := sumatoria*0.25;
end;
total_a_pagar := sumatoria+descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de sumatoria: ', sumatoria: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 articulo_01, articulo_02, articulo_03, articulo_04, articulo_05 : real;
var articulo_06, articulo_07, articulo_08, articulo_09, articulo_10 : real;
var descuento, sumatoria, total_a_pagar : real;
begin
write ('Ingresa el valor de articulo 01: ');
readln (articulo_01);
write ('Ingresa el valor de articulo 02: ');
readln (articulo_02);
write ('Ingresa el valor de articulo 03: ');
readln (articulo_03);
write ('Ingresa el valor de articulo 04: ');
readln (articulo_04);
write ('Ingresa el valor de articulo 05: ');
readln (articulo_05);
write ('Ingresa el valor de articulo 06: ');
readln (articulo_06);
write ('Ingresa el valor de articulo 07: ');
readln (articulo_07);
write ('Ingresa el valor de articulo 08: ');
readln (articulo_08);
write ('Ingresa el valor de articulo 09: ');
readln (articulo_09);
write ('Ingresa el valor de articulo 10: ');
readln (articulo_10);
sumatoria := articulo_01+articulo_02+articulo_03+articulo_04+articulo_05+articulo_06+articulo_07+articulo_08+articulo_09+articulo_10;
descuento := 0;
if sumatoria<5000 then
begin
descuento := sumatoria*0.15;
end;
if (sumatoria>=5000) and (sumatoria<=10000) then
begin
descuento := sumatoria*0.20;
end;
if sumatoria>10000 then
begin
descuento := sumatoria*0.25;
end;
total_a_pagar := sumatoria+descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de sumatoria: ', sumatoria:0:6);
writeln ('Valor de total a pagar: ', total_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.