• Lenguaje

    Pascal

  • Descripción

    Un banco realiza el pago de intereses a sus clientes por un deposito de acuerdo a la siguiente información: tipo de moneda, tiempo de deposito y monto depositado. Los intereses serán aplicados según el siguiente cuadro:

    Meses | Soles (%) | Dólares (%)
    0 - 5 | 2 | 3
    6 - 12 | 6 | 4
    13 - más | 9 | 7

    Determine:
    1. El interés del depósito.
    2. Mostrar el monto deposito, tiempo de depósito y tipo de moneda.
    3. Monto total a recibir.

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
program PagoDeIntereses;
uses crt;

var tipo_de_moneda : integer;
var interes_del_deposito, monto_depositado, tiempo_de_deposito, total_a_recibir : real;
begin
    write ('Ingresa el valor de monto depositado: ');
    readln (monto_depositado);
    write ('Ingresa el valor de tiempo de deposito: ');
    readln (tiempo_de_deposito);
    writeln ('Selecciona el valor de tipo de moneda.');
    writeln ('    1.- Soles');
    writeln ('    2.- D'#162'lares');
    write ('    : ');
    repeat
        readln (tipo_de_moneda);
        if (tipo_de_moneda<1) or (tipo_de_moneda>2) then
            write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
    until (tipo_de_moneda>=1) and (tipo_de_moneda<=2);
    interes_del_deposito := 0;
    if (tipo_de_moneda=1) and (tiempo_de_deposito>=0) and (tiempo_de_deposito<6) then
        begin
            interes_del_deposito := 2;
        end;
    if (tipo_de_moneda=1) and (tiempo_de_deposito>=6) and (tiempo_de_deposito<13) then
        begin
            interes_del_deposito := 6;
        end;
    if (tipo_de_moneda=1) and (tiempo_de_deposito>=13) then
        begin
            interes_del_deposito := 9;
        end;
    if (tipo_de_moneda=2) and (tiempo_de_deposito>=0) and (tiempo_de_deposito<6) then
        begin
            interes_del_deposito := 3;
        end;
    if (tipo_de_moneda=2) and (tiempo_de_deposito>=6) and (tiempo_de_deposito<13) then
        begin
            interes_del_deposito := 4;
        end;
    if (tipo_de_moneda=2) and (tiempo_de_deposito>=13) then
        begin
            interes_del_deposito := 7;
        end;
    total_a_recibir := monto_depositado+monto_depositado*interes_del_deposito/100;
    writeln ('Valor de interes del deposito: ', interes_del_deposito:0:6);
    writeln ('Valor de total a recibir: ', total_a_recibir:0:6);
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.