-
Lenguaje
Pascal
-
Descripción
En un banco los intereses a pagar dependen del plazo al que se efectúe el préstamo. Si es a 24 meses, se paga 12% de interés anual, si es a 18 meses el 10%, a 12 meses el 9%, a 6 meses el 8% y a 3 meses el 6%. Ingrese cuánto dinero y el plazo al que se realizará el préstamo y determine el interés anual a pagarse.
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
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
program InteresesEnUnBanco;
uses crt;
var dinero, interes, plazo : real;
begin
write ('Ingresa el valor de dinero: ');
readln (dinero);
write ('Ingresa el valor de plazo: ');
readln (plazo);
interes := 0;
if plazo=24 then
begin
interes := dinero*0.12;
end;
if plazo=18 then
begin
interes := dinero*0.10;
end;
if plazo=12 then
begin
interes := dinero*0.09;
end;
if plazo=6 then
begin
interes := dinero*0.08;
end;
if plazo=3 then
begin
interes := dinero*0.06;
end;
if interes=0 then
begin
writeln ('Plazo incorrecto.');
end;
writeln ('Valor de interes: ', interes:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var dinero, interes, plazo : real;
begin
write ('Ingresa el valor de dinero: ');
readln (dinero);
write ('Ingresa el valor de plazo: ');
readln (plazo);
interes := 0;
if plazo=24 then
begin
interes := dinero*0.12;
end;
if plazo=18 then
begin
interes := dinero*0.10;
end;
if plazo=12 then
begin
interes := dinero*0.09;
end;
if plazo=6 then
begin
interes := dinero*0.08;
end;
if plazo=3 then
begin
interes := dinero*0.06;
end;
if interes=0 then
begin
writeln ('Plazo incorrecto.');
end;
writeln ('Valor de interes: ', interes:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.