• Lenguaje

    Pascal

  • Descripción

    El banco de las Islas Caimán necesita crear un programa que permita a sus empleados consultar cual es el porcentaje de interés de un préstamo a partir del tipo de crédito y del monto que se desea solicitar, para ello es necesario tener en cuenta:
    Categorías:
    - Tipo A: Hipotecario: 5% de interés para créditos menores o iguales a 100 millones, mayores a 100 millones pagan 4% de interés. El monto tope de préstamo es de 200 millones.
    - Tipo B: Libre Inversión: 8% de Interés de interés para créditos menores o iguales a 5 millones, mayores a 5 millones pagan 6% de interés. El monto tope de préstamo es de 15 millones.
    - Tipo C: Especial: 10% de interés de interés para créditos menores o iguales a 20 millones, mayores a 20 millones pagan 8% de interés. El monto Tope de préstamo es de 35 millones.
    El usuario Ingresa inicialmente una de las categorías (A, B o C) y el monto de crédito, a partir de allí el programa debe de mostrarle al usuario que porcentaje aplica para el crédito solicitado.
    Nota: Es necesario tener presente que, si el monto ingresado por el usuario supera el tope establecido en la categoría seleccionada, se le debe de mostrar un mensaje informativo al cliente.

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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
program BancoDeLasIslasCaiman;
uses crt;

var categoria : integer;
var credito, interes, tope : real;
begin
    write ('Ingresa el valor de credito: ');
    readln (credito);
    writeln ('Selecciona el valor de categoria.');
    writeln ('    1.- Tipo A');
    writeln ('    2.- Tipo B');
    writeln ('    3.- Tipo C');
    write ('    : ');
    repeat
        readln (categoria);
        if (categoria<1) or (categoria>3) then
            write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
    until (categoria>=1) and (categoria<=3);
    tope := 0;
    interes := 0;
    if categoria=1 then
        begin
            writeln ('Hipotecario');
            tope := 200000000;
        end;
    if categoria=2 then
        begin
            writeln ('Libre Inversi'#162'n');
            tope := 15000000;
        end;
    if categoria=3 then
        begin
            writeln ('Especial');
            tope := 35000000;
        end;
    if credito>tope then
        begin
            writeln ('Mensaje informativo. El cr'#130'dito supera el monto tope.');
        end;
    if (credito<=tope) and (categoria=1) and (credito<=100000000) then
        begin
            interes := credito*0.05;
        end;
    if (credito<=tope) and (categoria=1) and (credito>100000000) then
        begin
            interes := credito*0.04;
        end;
    if (credito<=tope) and (categoria=2) and (credito<=5000000) then
        begin
            interes := credito*0.08;
        end;
    if (credito<=tope) and (categoria=2) and (credito>5000000) then
        begin
            interes := credito*0.06;
        end;
    if (credito<=tope) and (categoria=3) and (credito<=20000000) then
        begin
            interes := credito*0.1;
        end;
    if (credito<=tope) and (categoria=3) and (credito>20000000) then
        begin
            interes := credito*0.08;
        end;
    writeln ('Valor de interes: ', interes:0:6);
    writeln ('Valor de tope: ', tope:0:6);
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.