• Lenguaje

    Pascal

  • Descripción

    Calcule el monto por impuesto predial. El impuesto dependerá del área que ocupa la casa (Ingresado por teclado), de los años de construcción y del material de construcción. Para calcular el impuesto debe considerarse el siguiente cuadro:

    AÑOS DE CONSTRUCCIÓN | IMPUESTO ($/M2)
    0 - 5 | 2.00
    6 -10 | 1.20
    11 - 15 | 0.85
    16 a más | 0.25

    De acuerdo al material de construcción el impuesto resultante aumentara en los porcentajes indicados:

    MATERIAL DE CONSTRUCCIÓN | AUMENTO (%)
    Concreto | 25
    Ladrillo | 12
    Adobe | 3

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

var material_de_construccion : integer;
var anios_de_construccion, area, aumento, impuesto, predial : real;
begin
    write ('Ingresa el valor de anios de construccion: ');
    readln (anios_de_construccion);
    write ('Ingresa el valor de area: ');
    readln (area);
    impuesto := 0;
    aumento := 0;
    writeln ('Selecciona el valor de material de construccion.');
    writeln ('    1.- Concreto');
    writeln ('    2.- Ladrillo');
    writeln ('    3.- Adobe');
    write ('    : ');
    repeat
        readln (material_de_construccion);
        if (material_de_construccion<1) or (material_de_construccion>3) then
            write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
    until (material_de_construccion>=1) and (material_de_construccion<=3);
    if anios_de_construccion<6 then
        begin
            impuesto := area*2;
        end;
    if (anios_de_construccion>=6) and (anios_de_construccion<11) then
        begin
            impuesto := area*1.2;
        end;
    if (anios_de_construccion>=11) and (anios_de_construccion<16) then
        begin
            impuesto := area*0.85;
        end;
    if anios_de_construccion>=16 then
        begin
            impuesto := area*0.25;
        end;
    if material_de_construccion=1 then
        begin
            aumento := impuesto*0.25;
        end;
    if material_de_construccion=2 then
        begin
            aumento := impuesto*0.12;
        end;
    if material_de_construccion=3 then
        begin
            aumento := impuesto*0.03;
        end;
    predial := impuesto+aumento;
    writeln ('Valor de aumento: ', aumento:0:6);
    writeln ('Valor de impuesto: ', impuesto:0:6);
    writeln ('Valor de predial: ', predial:0:6);
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.