Pascal/Turbo Pascal - Ayuda 2 programas!!

 
Vista:
sin imagen de perfil

Ayuda 2 programas!!

Publicado por Miguel (6 intervenciones) el 15/11/2012 13:27:27
Muy buenas a todos, a ver si me pueden ayudar hacer estos programas:

1: Realizar un programa que acepte su nombre y un numero y luego imprima su nombre de acuerdo a las siguientes opciones...

1=Azul
2=Verde
3=cyan
4=rojo
c/t= mensaje de error

2:Realizar un programa que insertando dos numeros positivos imprima su rango debe de funcionar sin importar el orden en que se introduscan si los numeros son iguales el programa finaliza.

Muchas gracias de antemano.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Ayuda 2 programas!!

Publicado por ramon (2158 intervenciones) el 15/11/2012 19:32:26
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{A ver si es esto}
 
program imprime;
 uses
    crt;
  var
    nombre : string;
    nume : integer;
 
   procedure textocolores;
   begin
       clrscr;
       write('Entre Nombre : ');
       readln(nombre);
       writeln('Entre Numero Del 1 al 4 : ');
       readln(nume);
       textcolor(15);
    case nume of
  1 : textcolor(1);
  2 : textcolor(2);
  3 : textcolor(3);
  4 : textcolor(4);
  end;
    if nume in[1..4] then
    begin
       clrscr;
       writeln(nombre);
    end
  else
     begin
       clrscr;
       writeln('Error');
     end;
     textcolor(15);
     readln;
   end;
 
   procedure rango;
   var
     n, n1, n2 : integer;
    begin
      repeat
        clrscr;
        write('Entre Primer Numero : ');
        readln(n1);
        write('Entre Segundo Numero : ');
        readln(n2);
        if n1 > n2 then
        begin
           n := n1;
           n1 := n2;
           n2 := n;
        end;
        if n1 < n2 then
        begin
        writeln(' El Rango Es = ',n2 - n1);
        writeln(' Termina Sison Iguales Pulse [Enter]');
        readkey;
        end;
    until n1 = n2;
    end;
 
   procedure menu;
   var
     tr : char;
     begin
      repeat
      clrscr;
      writeln('**** Menu ****');
      writeln;
      writeln(' 1 = Texto a Color');
      writeln(' 2 = Rango Numero');
      writeln(' 3 = Salir');
      writeln;
      writeln('<<< Elije Opcion >>>');
      repeat
      tr := readkey;
      until tr in['1','2','3'];
   case tr of
  '1' : textocolores;
  '2' : rango;
  end;
      until tr = '3';
   end;
 
   begin
     clrscr;
     textcolor(15);
     menu;
     textcolor(15);
   end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar
sin imagen de perfil

Ayuda 2 programas!!

Publicado por Miguel (6 intervenciones) el 13/12/2012 05:53:59
Ramon una vez más muchas gracias por la ayuda hermano.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar