Pascal/Turbo Pascal - URGENTE!!!!!!! Diccionario en pascal

 
Vista:

URGENTE!!!!!!! Diccionario en pascal

Publicado por Tania (5 intervenciones) el 01/05/2013 01:14:55
Hola!! necesito ayuda urgente con un programa en pascal para hacer un diccionario en el que el usuario introduzca un verbo en ingles y le de el significado , y la conjugación aparte de que aparazca de diferente color los verbos irregulares de los regulares ....


Gracias....
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

URGENTE!!!!!!! Diccionario en pascal

Publicado por ramon (2158 intervenciones) el 01/05/2013 16:43:35
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{Mira esto es como de veras de empezar a partir de esto entra todo lo que quieras ampliando
 los datos del registro pero ten en cuenta que cada vez que modifiques el registro los datos
 guardados anterior mente no podrás leerlos puesto que cambia la estructura del registro
 con relación a lo guardado anterior mente ten eso en cuenta antes de entrar datos.
 Fíjate que creo un archivo de prueba pero tu tendrás que entrar los datos a mano o
cargándolos de algún archivo que los tenga si empre y cuando conozcas su estructura.}
 
program diciona;
 uses
    crt;
 const
   ingles : array[1..14] of string[30] = (
  'Abacus','Abaft','Abandon','Abandonment','Abandonment',
  'Abase','Abasement','Abash','Baa','Babble','Babe',
  'Cabin','Cabinet-maker','Calamity');
 
   espayol : array[1..14] of string[80] = (
   'Abaco ? tabla aritmética ¨','A popa','Abandonar','Abandono',
   'Envilecer, humillar','Envilecimiento','Avergonzar','Balar',
   'Balbucear','Charlar, charlataneria','Criatura, infante',
   'Caba¤a, choza','Ebanista','Calamidad');
 
   archivo = 'Dicionar.dat';
 
 type
   regdici = record
          ing : string[30];
          esp : string[80];
         end;
 
 
  var
    dic : array[0..500] of regdici;
    cont : integer;
    f : file of regdici;
    tecla : char;
    conarchi : longint;
 
  procedure creaarchivoprueba;
  begin
     assign(f,archivo);
     rewrite(f);
     for cont := 1 to  14 do
     begin
        dic[0].ing := ingles[cont];
        dic[0].esp := espayol[cont];
        seek(f,cont - 1);
        write(f,dic[0]);
     end;
       close(f);
  end;
 
  procedure entradadatosdici;
  var
    entrada : regdici;
  begin
      assign(f,archivo);
  {$I-} reset(f); {$I+}
  if ioresult <> 0 then
  begin
      clrscr;
      writeln('**** Entradas Diccionario ****');
      writeln;
      write('   Frase Ingles      : ');
      readln(entrada.ing);
      write('   Traducion espa¤ol : ');
      readln(entrada.esp);
      seek(f,0);
      write(f, entrada);
      close(f);
  end
 else
     begin
      clrscr;
      writeln('**** Entradas Diccionario ****');
      writeln;
      write('   Frase Ingles      : ');
      readln(entrada.ing);
      write('   Traducion espa¤ol : ');
      readln(entrada.esp);
      seek(f,filesize(f));
      write(f, entrada);
      close(f);
  end;
 end;
 
 procedure buscafrase;
 var
    frase : string[30];
    d : integer;
    entrada : regdici;
    encont : boolean;
 begin
     clrscr;
     encont := false;
     writeln('**** Frase A Traducir ****');
     writeln;
     write('  Frase En Ingles : ');
     readln(frase);
     for d := 1 to length(frase) do
     frase[d] := upcase(frase[d]);
     assign(f,archivo);
  {$I-} reset(f); {$I+}
  if ioresult <> 0 then
  begin
     writeln('Error : El Archivo No Existe Pulse [Enter]');
     readln;
     exit;
  end
 else
    begin
       for cont := 0 to filesize(f) - 1 do
       begin
          seek(f,cont);
          read(f,entrada);
          for d := 1 to length(entrada.ing) do
          entrada.ing[d] := upcase(entrada.ing[d]);
          if entrada.ing = frase then
          begin
             encont := true;
             break;
          end;
       end;
         close(f);
         if encont = true then
         begin
         clrscr;
         writeln('****** Su Traducion Es ******');
         writeln;
         writeln('    ',entrada.ing,' = ',entrada.esp);
         writeln;
         writeln('      Pulse Una Tecla');
         readkey;
        end
      else
         begin
         writeln('  Frase = ',frase,' No Encontrada');
         writeln('  Pulse Una Tecla');
         readkey;
         end;
       end;
     end;
 
  begin
      creaarchivoprueba;
      buscafrase;
  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

URGENTE!!!!!!! Diccionario en pascal

Publicado por tania (5 intervenciones) el 01/05/2013 20:03:19
Hola otra cosa me sale error en el ultimo paréntesis de las palabras en español :S






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
129
130
131
132
133
134
135
program diciona;
 uses
    crt;
 const
   ingles : array[1..7] of string[30] = (
  'accept’,’add’,’admire’,’admit’,’advise’,’allow’,’amuse’);

   espayol : array[1..7] of string[80] = (
   ‘aceptar Accept accepted accepted’,’admirar admire admired admired’,admitir admit admited admited’,’aconsejar advise advised advised’,’permitir allow allowed allowed’,’entretener amuse amused amused');
 
   archivo = 'Dicionar.dat';
 
 type
   regdici = record
          ing : string[30];
          esp : string[80];
         end;
 
 
  var
    dic : array[0..500] of regdici;
    cont : integer;
    f : file of regdici;
    tecla : char;
    conarchi : longint;
 
  procedure creaarchivoprueba;
  begin
     assign(f,archivo);
     rewrite(f);
     for cont := 1 to  14 do
     begin
        dic[0].ing := ingles[cont];
        dic[0].esp := espayol[cont];
        seek(f,cont - 1);
        write(f,dic[0]);
     end;
       close(f);
  end;
 
  procedure entradadatosdici;
  var
    entrada : regdici;
  begin
      assign(f,archivo);
  {$I-} reset(f); {$I+}
  if ioresult <> 0 then
  begin
      clrscr;
      writeln('**** Entradas Diccionario ****');
      writeln;
      write('   Verbo Ingles      : ');
      readln(entrada.ing);
      write('   Conjugacion y significado espa¤ol : ');
      readln(entrada.esp);
      seek(f,0);
      write(f, entrada);
      close(f);
  end
 else
     begin
      clrscr;
      writeln('**** Entradas Diccionario ****');
      writeln;
      write('   Verbo  Ingles      : ');
      readln(entrada.ing);
      write('  Conjugacion y significado espa¤ol : ');
      readln(entrada.esp);
      seek(f,filesize(f));
      write(f, entrada);
      close(f);
  end;
 end;
 
 procedure buscafrase;
 var
    frase : string[30];
    d : integer;
    entrada : regdici;
    encont : boolean;
 begin
     clrscr;
     encont := false;
     writeln('**** Verbo a conjugar ****');
     writeln;
     write('  Verbo En Ingles : ');
     readln(frase);
     for d := 1 to length(frase) do
     frase[d] := upcase(frase[d]);
     assign(f,archivo);
  {$I-} reset(f); {$I+}
  if ioresult <> 0 then
  begin
     writeln('Error : El Archivo No Existe Pulse [Enter]');
     readln;
     exit;
  end
 else
    begin
       for cont := 0 to filesize(f) - 1 do
       begin
          seek(f,cont);
          read(f,entrada);
          for d := 1 to length(entrada.ing) do
          entrada.ing[d] := upcase(entrada.ing[d]);
          if entrada.ing = frase then
          begin
             encont := true;
             break;
          end;
       end;
         close(f);
         if encont = true then
         begin
         clrscr;
         writeln('****** Su conjugacion Es ******');
         writeln;
         writeln('    ',entrada.ing,' = ',entrada.esp);
         writeln;
         writeln('      Pulse Una Tecla');
         readkey;
        end
      else
         begin
         writeln('  Frase = ',frase,' No Encontrada');
         writeln('  Pulse Una Tecla');
         readkey;
         end;
       end;
     end;
 
  begin
      creaarchivoprueba;
      buscafrase;
  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

URGENTE!!!!!!! Diccionario en pascal

Publicado por ramon (2158 intervenciones) el 01/05/2013 20:13:30
Fijate que tienes 6 respuestas no 7 y falta comilla}

espayol : array[1..7] of string[80] = (
‘aceptar Accept accepted accepted’,
’admirar admire admired admired’,

a qui te la pongo

'admitir admit admited admited’,
’aconsejar advise advised advised’,
’permitir allow allowed allowed’,
’entretener amuse amused amused');
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

URGENTE!!!!!!! Diccionario en pascal

Publicado por Tania (5 intervenciones) el 01/05/2013 21:07:26
perdon por molestarte tanto . ya lo corregí y si compilo pero ahora no corre


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
129
130
131
132
133
134
135
136
137
138
139
140
141
program diciona;
 uses
    crt;
 const
   ingles : array[1..7] of string[30] = (
  'accept','add','admire','admit','advise','allow','amuse');
 
   espayol : array[1..7] of string[80] = (
   'aceptar Accept accepted accepted',
   'agregar add added added',
   'admirar admire admired admired',
   'admitir admit admited admited',
   'aconsejar advise advised advised',
   'permitir allow allowed allowed',
   'entretener amuse amused amused');
 
   archivo = 'Dicionar.dat';
 
 type
   regdici = record
          ing : string[30];
          esp : string[80];
         end;
 
 
  var
    dic : array[0..500] of regdici;
    cont : integer;
    f : file of regdici;
    tecla : char;
    conarchi : longint;
 
  procedure creaarchivoprueba;
  begin
     assign(f,archivo);
     rewrite(f);
     for cont := 1 to  14 do
     begin
        dic[0].ing := ingles[cont];
        dic[0].esp := espayol[cont];
        seek(f,cont - 1);
        write(f,dic[0]);
     end;
       close(f);
  end;
 
  procedure entradadatosdici;
  var
    entrada : regdici;
  begin
      assign(f,archivo);
  {$I-} reset(f); {$I+}
  if ioresult <> 0 then
  begin
      clrscr;
      writeln('**** Entradas Diccionario ****');
      writeln;
      write('   Verbo Ingles      : ');
      readln(entrada.ing);
      write('   Conjugacion y significado espa¤ol : ');
      readln(entrada.esp);
      seek(f,0);
      write(f, entrada);
      close(f);
  end
 else
     begin
      clrscr;
      writeln('**** Entradas Diccionario ****');
      writeln;
      write('   Verbo  Ingles      : ');
      readln(entrada.ing);
      write('  Conjugacion y significado espa¤ol : ');
      readln(entrada.esp);
      seek(f,filesize(f));
      write(f, entrada);
      close(f);
  end;
 end;
 
 procedure buscafrase;
 var
    frase : string[30];
    d : integer;
    entrada : regdici;
    encont : boolean;
 begin
     clrscr;
     encont := false;
     writeln('**** Verbo a conjugar ****');
     writeln;
     write('  Verbo En Ingles : ');
     readln(frase);
     for d := 1 to length(frase) do
     frase[d] := upcase(frase[d]);
     assign(f,archivo);
  {$I-} reset(f); {$I+}
  if ioresult <> 0 then
  begin
     writeln('Error : El Archivo No Existe Pulse [Enter]');
     readln;
     exit;
  end
 else
    begin
       for cont := 0 to filesize(f) - 1 do
       begin
          seek(f,cont);
          read(f,entrada);
          for d := 1 to length(entrada.ing) do
          entrada.ing[d] := upcase(entrada.ing[d]);
          if entrada.ing = frase then
          begin
             encont := true;
             break;
          end;
       end;
         close(f);
         if encont = true then
         begin
         clrscr;
         writeln('****** Su conjugacion Es ******');
         writeln;
         writeln('    ',entrada.ing,' = ',entrada.esp);
         writeln;
         writeln('      Pulse Una Tecla');
         readkey;
        end
      else
         begin
         writeln('  Frase = ',frase,' No Encontrada');
         writeln('  Pulse Una Tecla');
         readkey;
         end;
       end;
     end;
 
  begin
      creaarchivoprueba;
      buscafrase;
  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

URGENTE!!!!!!! Diccionario en pascal

Publicado por tania (5 intervenciones) el 01/05/2013 21:41:07
Ya me salio muchisimas gracias en serio me has salvado la vida !!!!!! mil gracias..........!!!!! eres un genio
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