-
Lenguaje
Pascal
-
Descripción
La empresa Aguas de Bogotá los contrata a usted como programador para que le realice un sistema de información para que solucione el siguiente requerimiento que tiente:
La empresa Aguas de Bogotá posee dos tipos de clientes: residencial y empresarial.
Permita procesar "n" cantidad de clientes teniendo como datos por cada uno de ellos:
- Código del cliente.
- Tipo de cliente (residencial o empresarial).
- Lectura actual de consumo en mt³.
- Lectura anterior en mt³.
Calculando y dando como salida la cantidad de mt³ y el neto a pagar por cada cliente.
El consumo se cobran a razón de:
- Residencial $8,500 por mt³.
- Empresarial $10,800 por mt³.
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
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
program ConsumoDeAguaResidencialYEmpresarial;
uses crt;
var i, n, tipo_de_cliente : integer;
var cantidad_de_mt3, lectura_actual, lectura_anterior, neto_a_pagar : real;
var codigo_del_cliente : string;
begin
write ('Ingresa el valor de n: ');
readln (n);
for i:=1 to n do
begin
writeln ('PROCESO ', i);
write ('Ingresa el codigo del cliente: ');
readln (codigo_del_cliente);
write ('Ingresa el valor de lectura actual: ');
readln (lectura_actual);
write ('Ingresa el valor de lectura anterior: ');
readln (lectura_anterior);
writeln ('Selecciona el valor de tipo de cliente.');
writeln (' 1.- Residencial');
writeln (' 2.- Empresarial');
write (' : ');
repeat
readln (tipo_de_cliente);
if (tipo_de_cliente<1) or (tipo_de_cliente>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (tipo_de_cliente>=1) and (tipo_de_cliente<=2);
cantidad_de_mt3 := lectura_actual-lectura_anterior;
if tipo_de_cliente=1 then
begin
neto_a_pagar := cantidad_de_mt3*8500;
end
else
begin
neto_a_pagar := cantidad_de_mt3*10800;
end;
writeln ('Codigo del cliente: ', codigo_del_cliente);
writeln ('Valor de cantidad de mt3: ', cantidad_de_mt3:0:6);
writeln ('Valor de neto a pagar: ', neto_a_pagar:0:6);
writeln;
end;
end.
uses crt;
var i, n, tipo_de_cliente : integer;
var cantidad_de_mt3, lectura_actual, lectura_anterior, neto_a_pagar : real;
var codigo_del_cliente : string;
begin
write ('Ingresa el valor de n: ');
readln (n);
for i:=1 to n do
begin
writeln ('PROCESO ', i);
write ('Ingresa el codigo del cliente: ');
readln (codigo_del_cliente);
write ('Ingresa el valor de lectura actual: ');
readln (lectura_actual);
write ('Ingresa el valor de lectura anterior: ');
readln (lectura_anterior);
writeln ('Selecciona el valor de tipo de cliente.');
writeln (' 1.- Residencial');
writeln (' 2.- Empresarial');
write (' : ');
repeat
readln (tipo_de_cliente);
if (tipo_de_cliente<1) or (tipo_de_cliente>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (tipo_de_cliente>=1) and (tipo_de_cliente<=2);
cantidad_de_mt3 := lectura_actual-lectura_anterior;
if tipo_de_cliente=1 then
begin
neto_a_pagar := cantidad_de_mt3*8500;
end
else
begin
neto_a_pagar := cantidad_de_mt3*10800;
end;
writeln ('Codigo del cliente: ', codigo_del_cliente);
writeln ('Valor de cantidad de mt3: ', cantidad_de_mt3:0:6);
writeln ('Valor de neto a pagar: ', neto_a_pagar:0:6);
writeln;
end;
end.