-
Lenguaje
Pascal
-
Descripción
CADELA tiene una promoción denominada LUZ AL DÍA que consiste en dar descuentos a las personas que deben recibos de luz desde hace varios años. El recibo que se emitió antes del año 1996, recibirá un descuento del 65%. El recibo que se emitió entre el año 1996 y el 2000 recibirá un descuento del 45%. El recibo que se emitió después del año 2000 recibirá un descuento del 8%. Realice un algoritmo, que teniendo los datos de entrada de 2000 clientes: Año del recibo, monto del consumo de luz (sin descuento), determine:
a) Monto a pagar por el consumo de luz
b) Monto del descuento.
c) Monto a pagar por aseo urbano, el cual corresponde a 1000 Bs. por cada año de atraso.
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
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
program PromocionLuzAlDia;
uses crt;
var i : integer;
var ano_del_recibo, aseo_urbano, consumo_de_luz, descuento, monto_a_pagar : real;
begin
for i:=1 to 2000 do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de ano del recibo: ');
readln (ano_del_recibo);
write ('Ingresa el valor de consumo de luz: ');
readln (consumo_de_luz);
descuento := 0;
if ano_del_recibo<1996 then
begin
descuento := consumo_de_luz*0.65;
end;
if (ano_del_recibo>=1996) and (ano_del_recibo<=2000) then
begin
descuento := consumo_de_luz*0.45;
end;
if ano_del_recibo>2000 then
begin
descuento := consumo_de_luz*0.08;
end;
aseo_urbano := (2017-ano_del_recibo)*1000;
monto_a_pagar := consumo_de_luz-descuento+aseo_urbano;
writeln ('Valor de aseo urbano: ', aseo_urbano:0:6);
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de monto a pagar: ', monto_a_pagar:0:6);
writeln;
end;
end.
uses crt;
var i : integer;
var ano_del_recibo, aseo_urbano, consumo_de_luz, descuento, monto_a_pagar : real;
begin
for i:=1 to 2000 do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de ano del recibo: ');
readln (ano_del_recibo);
write ('Ingresa el valor de consumo de luz: ');
readln (consumo_de_luz);
descuento := 0;
if ano_del_recibo<1996 then
begin
descuento := consumo_de_luz*0.65;
end;
if (ano_del_recibo>=1996) and (ano_del_recibo<=2000) then
begin
descuento := consumo_de_luz*0.45;
end;
if ano_del_recibo>2000 then
begin
descuento := consumo_de_luz*0.08;
end;
aseo_urbano := (2017-ano_del_recibo)*1000;
monto_a_pagar := consumo_de_luz-descuento+aseo_urbano;
writeln ('Valor de aseo urbano: ', aseo_urbano:0:6);
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de monto a pagar: ', monto_a_pagar:0:6);
writeln;
end;
end.