-
Lenguaje
Pascal
-
Descripción
Un agricultor desea fumigar sus plantíos de café para protegerlas de las principales plagas que las afectan, para lo cual,
contrata una empresa que brinda servicios de fumigación, la cual cobra sus servicios de acuerdo al cuadro adjunto:
Tipo | Fumigación contra | Precio $ (por Hectarea)
1 | La broca | 20
2 | El minador de la hoja | 30
3 | La palomilla de las raíces | 40
4 | Todas las anteriores | 70
Si el área a fumigar es mayor de 50 hectáreas se tiene un descuento del 10%. Mostrar lo siguiente:
- Cálculo del monto a pagar (bruto).
- Cálculo del monto del descuento.
- Cálculo del 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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
50
51
52
program FumigacionDePlantios;
uses crt;
var tipo_de_fumigacion : integer;
var descuento, hectareas, monto_a_pagar, total_a_pagar : real;
begin
write ('Ingresa el valor de hectareas: ');
readln (hectareas);
monto_a_pagar := 0;
writeln ('Selecciona el valor de tipo de fumigacion.');
writeln (' 1.- La broca');
writeln (' 2.- El minador de la hoja');
writeln (' 3.- La palomilla de las ra'#161'ces');
writeln (' 4.- Todas las anteriores');
write (' : ');
repeat
readln (tipo_de_fumigacion);
if (tipo_de_fumigacion<1) or (tipo_de_fumigacion>4) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (tipo_de_fumigacion>=1) and (tipo_de_fumigacion<=4);
if tipo_de_fumigacion=1 then
begin
monto_a_pagar := hectareas*20;
end;
if tipo_de_fumigacion=2 then
begin
monto_a_pagar := hectareas*30;
end;
if tipo_de_fumigacion=3 then
begin
monto_a_pagar := hectareas*40;
end;
if tipo_de_fumigacion=4 then
begin
monto_a_pagar := hectareas*70;
end;
if hectareas>50 then
begin
descuento := monto_a_pagar*0.1;
end
else
begin
descuento := 0;
end;
total_a_pagar := monto_a_pagar-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de monto a pagar: ', monto_a_pagar: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 tipo_de_fumigacion : integer;
var descuento, hectareas, monto_a_pagar, total_a_pagar : real;
begin
write ('Ingresa el valor de hectareas: ');
readln (hectareas);
monto_a_pagar := 0;
writeln ('Selecciona el valor de tipo de fumigacion.');
writeln (' 1.- La broca');
writeln (' 2.- El minador de la hoja');
writeln (' 3.- La palomilla de las ra'#161'ces');
writeln (' 4.- Todas las anteriores');
write (' : ');
repeat
readln (tipo_de_fumigacion);
if (tipo_de_fumigacion<1) or (tipo_de_fumigacion>4) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (tipo_de_fumigacion>=1) and (tipo_de_fumigacion<=4);
if tipo_de_fumigacion=1 then
begin
monto_a_pagar := hectareas*20;
end;
if tipo_de_fumigacion=2 then
begin
monto_a_pagar := hectareas*30;
end;
if tipo_de_fumigacion=3 then
begin
monto_a_pagar := hectareas*40;
end;
if tipo_de_fumigacion=4 then
begin
monto_a_pagar := hectareas*70;
end;
if hectareas>50 then
begin
descuento := monto_a_pagar*0.1;
end
else
begin
descuento := 0;
end;
total_a_pagar := monto_a_pagar-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de monto a pagar: ', monto_a_pagar:0:6);
writeln ('Valor de total a pagar: ', total_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.