-
Lenguaje
Pascal
-
Descripción
Calcular la cantidad de dinero que ahorrara una persona en un un plazo de 2 años, obteniendo una tasa de interés del 4% bimestral. Debe leerse la cantidad a ahorrar mensualmente.
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
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
program AhorroDe2Anos;
uses crt;
var i : integer;
var ahorro_acumulado, ahorro_bimestre, ahorro_mensual, intereses : real;
begin
ahorro_acumulado := 0;
ahorro_bimestre := 0;
for i:=1 to 24 do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de ahorro mensual: ');
readln (ahorro_mensual);
ahorro_bimestre := ahorro_bimestre+ahorro_mensual;
if i mod 2=0 then
begin
intereses := ahorro_acumulado*0.04;
ahorro_acumulado := ahorro_acumulado+ahorro_bimestre+intereses;
ahorro_bimestre := 0;
end;
writeln ('Valor de intereses: ', intereses:0:6);
writeln;
end;
writeln ('Valor de ahorro acumulado: ', ahorro_acumulado:0:6);
writeln ('Valor de ahorro bimestre: ', ahorro_bimestre:0:6);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var i : integer;
var ahorro_acumulado, ahorro_bimestre, ahorro_mensual, intereses : real;
begin
ahorro_acumulado := 0;
ahorro_bimestre := 0;
for i:=1 to 24 do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de ahorro mensual: ');
readln (ahorro_mensual);
ahorro_bimestre := ahorro_bimestre+ahorro_mensual;
if i mod 2=0 then
begin
intereses := ahorro_acumulado*0.04;
ahorro_acumulado := ahorro_acumulado+ahorro_bimestre+intereses;
ahorro_bimestre := 0;
end;
writeln ('Valor de intereses: ', intereses:0:6);
writeln;
end;
writeln ('Valor de ahorro acumulado: ', ahorro_acumulado:0:6);
writeln ('Valor de ahorro bimestre: ', ahorro_bimestre:0:6);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.