Pascal/Turbo Pascal - Unidad_7_2 (2)

 
Vista:
sin imagen de perfil

Unidad_7_2 (2)

Publicado por Erik (73 intervenciones) el 05/05/2014 12:30:30
Hola me gustaria a ver si me pueden solucionar lo siguiente:
me sale el siguiente error en el programa que eh hecho.

64 / 3 unidad~1.pas
Fatal: Syntax error, identifier expected but BEGIN found

y ya tiene su end correspondiente, no se que hacer, ayuda por favor.
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
sin imagen de perfil

Unidad_7_2 (2)

Publicado por Erik (73 intervenciones) el 06/05/2014 10:32:21
se que necesita un parentesis al final del procedimiento, pero al ponerlo me sale error, no se que hacer.
gracias de antemano.
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

Unidad_7_2 (2)

Publicado por ramon (2158 intervenciones) el 07/05/2014 00:01:07
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{A qui lo tienes funcionando}
 
Program Galeria;
 uses
  crt;
(*-- Constantes globales al programa -- *)
 
Const
  TAMCOLECCION = 4;
 
(*-- Tipos globales al programa -- *)
Type
  coleccion = array[1..TAMCOLECCION] of real;
 
(*-- Variables del módulo principal -- *)
Var
  precios : Coleccion;
  prec : real;
 
(*-- Funciones y procedimientos -- *)
  procedure lee_tabla(var t : coleccion; n : integer);
var
   i : integer;
begin
   i := 1;
  writeln(' Entre Precio Cuadro ');
   while i < n + 1 do
  begin
     write(' Numero ',i,' : ');
     readln(t[i]);
     i := i + 1;
  end;
end;
  procedure imprime_tabla(t : coleccion; n : integer);
var
   i : integer;
   begin
    i := 1;
     writeln(' Los Resultados Son ');
     writeln;
     while i < n + 1 do
 begin
        writeln(' Num. : ',i,' Precio : ',t[i]:0:2);
        i := i + 1;
    end;
  end;
  function sumar_arreglo( var arreglo : coleccion) : real;
 var
     indice : integer;
      acumulador : real;
 begin
      for indice := 1 to TAMCOLECCION do
    begin
      acumulador := acumulador + arreglo[indice];
    end;
 
      sumar_arreglo := acumulador;
  end;
   procedure limites( arreglo : coleccion);
   var
     min: real;
     max : real;
     posMax: integer;
     posMin : integer;
     indice : integer;
  begin
   max := arreglo[1];
   min := -arreglo[1];
   posMax := -1;
   posMin := -1;
  for indice := 1 to TAMCOLECCION do
 
  begin
  if (arreglo[indice] > max) then
    begin
      max := arreglo[indice];
      posMax := indice;
    end;
   if (arreglo[indice] < min) then
  begin
   min := arreglo[indice];
   posMin := indice;
   end;
    end;
  end;
   Procedure busca_precio(cuadros:coleccion;tamano: integer;presupuesto:real);
   var i:integer;
   encontrado: integer;
    Begin
   encontrado:=0;
   for i:=1   to tamano do
    if (cuadros[i] = presupuesto) then
        begin
            writeln('El precio del cuadro numero ',i,' coincide con el precio a buscar.');
            readln;
            encontrado:= encontrado + 1;
        end;
    if (encontrado=0) then
        begin
            writeln('No se encontraron coincidencias'); writeln('******************************');
        end
    else
      begin
        writeln;
        writeln('Se han encontrado ', encontrado, ' coincidencias');
        write('Pulse enter para continuar');
        readln;
      end;
  end;
 
(*-- Programa Principal -- *)
 
 
 Begin
  clrscr;
  lee_tabla(precios, TAMCOLECCION);
  clrscr;
  imprime_tabla(precios, TAMCOLECCION);
  prec := 1;
  while prec > 0 do
   begin
    writeln;
    write(' Entre Precio A Buscar : ');
    readln(prec);
    busca_precio(precios, TAMCOLECCION, prec);
   end;
  readkey;
End.
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
sin imagen de perfil

Unidad_7_2 (2)

Publicado por Erik (73 intervenciones) el 07/05/2014 09:44:21
gracias pero ya lo eh solucionado, no era ahí donde lo has puesto, es al final en indice: integer
gracias de antemano.
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