• Lenguaje

    Pascal

  • Descripción

    Dado como datos la temperatura en grados Fahrenheit y un continente, determine qué tipo de árbol es recomendable para la reforestación.
    Temperatura | Continente | Tipo de árbol
    85 | América o Europa | Palma de cera
    Entre 85 y 70 | Europa o Asia | Cedro
    Entre 70 y 32 | América | Roble
    Entre 32 y 10 | Oceanía | Pino
    Menor igual a 10 | África | Eucalipto

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

var continente, temperatura : integer;
begin
    write ('Ingresa el valor de temperatura: ');
    readln (temperatura);
    writeln ('Selecciona el valor de continente.');
    writeln ('    1.- '#181'frica');
    writeln ('    2.- Am'#130'rica');
    writeln ('    3.- Asia');
    writeln ('    4.- Europa');
    writeln ('    5.- Ocean'#161'a');
    write ('    : ');
    repeat
        readln (continente);
        if (continente<1) or (continente>5) then
            write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
    until (continente>=1) and (continente<=5);
    if (temperatura=85) and ((continente=2) or (continente=4)) then
        begin
            writeln ('Palma de cera');
        end;
    if (temperatura<=85) and (temperatura>=70) and ((continente=4) or (continente=3)) then
        begin
            writeln ('Cedro');
        end;
    if (temperatura<=70) and (temperatura>=32) and (continente=2) then
        begin
            writeln ('Roble');
        end;
    if (temperatura<=32) and (temperatura>=10) and (continente=5) then
        begin
            writeln ('Pino');
        end;
    if (temperatura<=10) and (continente=1) then
        begin
            writeln ('Eucalipto');
        end;
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.