Pascal/Turbo Pascal - AYUDA CON PROYECTO EN PASCAL POR FAVOOOOOOR!!!

 
Vista:
sin imagen de perfil

AYUDA CON PROYECTO EN PASCAL POR FAVOOOOOOR!!!

Publicado por Jose (9 intervenciones) el 08/06/2014 07:03:24
AMIGO RAMÓN ESPERO TU AYUDA POR FAVOOOOOOORRRRR

Realice un programa que se encargue de crear un archivo llamado juegos.txt con la siguiente información: nombre del jugador, equipo al que pertenece, promedio de bateo, hits conectados, carreras impulsadas, bases robadas y números de home rounds conectados

El programa debe procesar las siguientes opciones:
1. Incluir.
2. Consultar
3. Modificar.
4. Eliminar.
5. Reportes.
6. Salir.

Tome en cuenta:
Cada una de estas opciones debe de estar en pantallas separas una vez seleccionada.

En las opciones incluir, consultar debe de ser por la cedula del jugador.

En la opción de reportes debe de imprimir por pantalla:
1. Listado de jugadores ordenados por hits conectados.
2. Listado de jugadores ordenados por home round conectados.
3. Listado de jugadores ordenados por promedio de bateos.

Antes de la pantalla menú debe de estar una pantalla de presentación con los datos de la universidad y de los integrantes. Los datos de la universidad son:

Republica Bolivariana de Venezuela
Ministerio del Poder popular para la Defensa
Universidad Nacional Experimental Politecnica De La Fuerza Armada
UNEFA- NUCLEO LARA
PROYECTO FINAL
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 CON PROYECTO EN PASCAL POR FAVOOOOOOR!!!

Publicado por ramon (2158 intervenciones) el 11/06/2014 00:45:27
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
{Esto te servirá o necesitas mas}
 
program proyecto;
  uses
     crt;
  const
     archivo = 'juegos.txt';
     presentacion : array[1..5] of string[70] = (
     'Republica Bolivariana de Venezuela',
     'Ministerio del Poder popular para la Defensa',
     'Universidad Nacional Experimental Politecnica De La Fuerza Armada',
     'UNEFA- NUCLEO LARA',
     'PROYECTO FINAL');
 
   elmenu = 7;
   menu_dato : array[1..elmenu] of string = (
   '1 : Incluir',
   '2 : Actualizar',
   '3 : Consultar',
   '4 : Modificar',
   '5 : Eliminar',
   '6 : Reportes',
   '7 : Salir');
 
  type
     regjugador = record
                     cedula : longint;
         nombre_del_jugador : string;
    equipo_al_que_pertenece : string[80];
     home_rounds_conectados : integer;
              bases_robadas : integer;
        carreras_impulsadas : integer;
            hits_conectados : integer;
          promedio_de_bateo : real;
                     end;
 
 
 
   var
     jugador : regjugador;
     f : file of regjugador;
     tecla : char;
 
 
   procedure pantalla_de_presentacion;
   begin
 gotoxy(5,1);write('ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ',
                     'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿');
 gotoxy(5,2);write('³');
 textcolor(10);
 gotoxy(21,2);write(presentacion[1]);
 textcolor(15);
 gotoxy(73,2);write('³');
 gotoxy(5,3);write('³');
 gotoxy(73,3);write('³');
 gotoxy(5,4);write('³');
 textcolor(12);
 gotoxy(16,4);write(presentacion[2]);
 textcolor(15);
 gotoxy(73,4);write('³');
 gotoxy(5,5);write('³');
 gotoxy(73,5);write('³');
 gotoxy(5,6);write('³');
 textcolor(14);
 gotoxy(7,6);write(presentacion[3]);
 textcolor(15);
 gotoxy(73,6);write('³');
 gotoxy(5,7);write('³');
 gotoxy(73,7);write('³');
 gotoxy(5,8);write('³');
 textcolor(2);
 gotoxy(30,8);write(presentacion[4]);
 textcolor(15);
 gotoxy(73,8);write('³');
 gotoxy(5,9);write('³');
 gotoxy(73,9);write('³');
 gotoxy(5,10);write('³');
 textcolor(7);
 gotoxy(32,10);write(presentacion[5]);
 textcolor(15);
 gotoxy(73,10);write('³');
 gotoxy(5,11);write('À');
 gotoxy(6,11);write('ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ',
                     'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ');
 gotoxy(73,11);write('Ù');
 gotoxy(27,13);write('**** Pulse Una Tecla ****');
 readkey;
   end;
 
   procedure guarda_a_archivo(reg : regjugador);
   begin
      assign(f,archivo);
   {$I-} reset(f); {$I+}
    if ioresult <> 0 then
    begin
       rewrite(f);
       seek(f,0);
       write(f,reg);
       close(f);
    end
  else
     begin
         seek(f,filesize(f));
         write(f,reg);
         close(f);
     end;
   end;
 
   procedure entada_datos_jugador;
   var
     pul : char;
   begin
      clrscr;
      with jugador do
      begin
      gotoxy(10,1);write('***** Datos Nuevo Jugador *****');
      gotoxy(2,3);write('Cedula Del Jugador [Numero Solo] : ');
      gotoxy(2,4);write('Nombre Del Jugador [Texto]       : ');
      gotoxy(2,5);write('Equipo Al Que Pertenece [Texto]  : ');
      gotoxy(2,7);write('<<< Datos Correctos [S/N] >>>');
      gotoxy(37,3);readln(cedula);
      gotoxy(37,4);readln(nombre_del_jugador);
      gotoxy(37,5);readln(equipo_al_que_pertenece);
      end;
      repeat
          pul := upcase(readkey);
      until pul in['S','N'];
      if pul = 'N' then
      entada_datos_jugador
    else
       begin
          with jugador do
          begin
             home_rounds_conectados := 0;
             bases_robadas := 0;
             carreras_impulsadas := 0;
             hits_conectados := 0;
             promedio_de_bateo := 0;
          end;
          guarda_a_archivo(jugador);
       end;
   end;
 
  procedure Consultar_jugador(ced : longint);
  var
     n, fds : longint;
     dato : regjugador;
     enco : boolean;
  begin
      writeln(' cedula es : ',ced);
      assign(f,archivo);
   {$I-} reset(f); {$I+}
    if ioresult <> 0 then
    begin
        writeln('  Error De Archivo Pulse Una Tecla');
        readkey;
    end
  else
      begin
         enco := false;
         n := 0;
         for fds := 0 to filesize(f) - 1 do
         begin
            seek(f,fds);
            read(f,dato);
            if dato.cedula = ced then
            begin
                n := fds;
                enco := true;
                break;
            end;
         end;
          if enco = true then
          begin
             clrscr;
 writeln('   ******* Datos Del Jugador Num Cedula : ',dato.cedula,' ******');
             writeln;
             writeln('  Nombre              = ',dato.nombre_del_jugador);
             writeln('  Equipa              = ',dato.equipo_al_que_pertenece);
             writeln('  Rounds Conectados   = ',dato.home_rounds_conectados);
             writeln('  Bases Rovadas       = ',dato.bases_robadas);
             writeln('  Carreras Impulsadas = ',dato.carreras_impulsadas);
             writeln('  Hits Conectados     = ',dato.hits_conectados);
             writeln('  Promedio De Bateo   = ',dato.promedio_de_bateo:0:2);
             writeln;
             writeln('<<<<< Pulse Una Tecla >>>>>');
             close(f);
          end
       else
          begin
             close(f);
             writeln('   Num. Cedula No Encontrado Pulse Una Tecla');
             readkey;
          end;
      end;
  end;
 
  procedure Actualizar_jugador(num : longint);
  var
    v, j : longint;
    ds : regjugador;
    enco : boolean;
   begin
      assign(f,archivo);
   {$I-} reset(f); {$I+}
    if ioresult <> 0 then
    begin
       writeln('   Error De Archivo pulsa Una Tecla');
       readkey;
    end
  else
     begin
        enco := false;
        for j := 0 to filesize(f) - 1 do
        begin
           seek(f,j);
           read(f,ds);
           if ds.cedula = num then
           begin
              enco := true;
              v := j;
              break;
           end;
        end;
        if enco = true then
        begin
           clrscr;
           writeln('   ***** Aztualiza Datos *****');
           writeln;
           write('  home rounds conectados : ');
           readln(ds.home_rounds_conectados);
           write('  bases robadas          : ');
           readln(ds.bases_robadas);
           write('  carreras impulsadas    : ');
           readln(ds.carreras_impulsadas);
           write('  hits conectados        : ');
           readln(ds.hits_conectados);
           write('  promedio de bateo      : ');
           readln(ds.promedio_de_bateo);
           seek(f,v);
           write(f,ds);
           close(f);
        end
      else
         begin
            writeln('  Codigo Cedula No Encontrado Pulse Una Tecla ');
            readkey;
            close(f);
         end;
     end;
   end;
 
   procedure Modificar_datos(bn : longint);
   var
     pp, dg : longint;
     datom : regjugador;
     sal, enco : boolean;
     nh : char;
   begin
     assign(f,archivo);
   {$I-} reset(f); {$I+}
    if ioresult <> 0 then
    begin
       writeln('   Error De Archivo pulsa Una Tecla');
       readkey;
    end
  else
     begin
        enco := false;
        for dg := 0 to filesize(f) - 1 do
        begin
           seek(f,dg);
           read(f,datom);
           if datom.cedula = bn then
           begin
              pp := dg;
              enco := true;
              break;
           end
        else
           begin
              writeln('  Codigo Cedula No Encontrado Pulse Una Tecla ');
              readkey;
              close(f);
           end;
        end;
          if enco = true then
          begin
             sal := false;
             repeat
                clrscr;
                writeln('   1 = Cedula');
                writeln('   2 = Nombre');
                writeln('   3 = Equipo Al Que Pertenece');
                writeln('   4 = Home Rounds Conectados');
                writeln('   5 = Bases Robadas');
                writeln('   6 = Carreras Impulsadas');
                writeln('   7 = Hits Conectados');
                writeln('   8 = Promedio De Bateo');
                writeln('   9 = Termina Modificacion ');
              repeat
                nh := readkey;
              until nh in['1','2','3','4','5','6','7','8','9'];
              clrscr;
       case nh of
 '1' : begin write('  cedula   : '); readln(datom.cedula); end;
 '2' : begin write('  nombre   : '); readln(datom.nombre_del_jugador); end;
 '3' : begin write('  equipo   : '); readln(datom.equipo_al_que_pertenece); end;
 '4' : begin write('  rounds   : '); readln(datom.home_rounds_conectados); end;
 '5' : begin write('  bases    : '); readln(datom.bases_robadas);   end;
 '6' : begin write('  carreras : '); readln(datom.carreras_impulsadas); end;
 '7' : begin write('  hits     : '); readln(datom.hits_conectados); end;
 '8' : begin write('  promedio : '); readln(datom.promedio_de_bateo); end;
 '9' : sal := true;
       end;
             until sal = true;
             seek(f,pp);
             write(f,datom);
             close(f);
          end;
      end;
    end;
 
  procedure Eliminar_jugador(nm : longint);
  var
    ttn, ll, bb : longint;
    tt : char;
    tem : file of regjugador;
    datom, date : regjugador;
    enco : boolean;
   begin
      assign(f,archivo);
   {$I-} reset(f); {$I+}
    if ioresult <> 0 then
    begin
       writeln('   Error De Archivo pulsa Una Tecla');
       readkey;
    end
  else
     begin
        enco := false;
        for bb := 0 to filesize(f) - 1 do
        begin
           seek(f,bb);
           read(f,datom);
           if datom.cedula = nm then
           begin
              ll := bb;
              enco := true;
              break;
           end
        else
           begin
              writeln('  Codigo Cedula No Encontrado Pulse Una Tecla ');
              readkey;
              close(f);
           end;
        end;
          if enco = true then
          begin
             ttn := 0;
             assign(tem,'tempo.tem');
             rewrite(tem);
             for bb := 0 to  filesize(f) - 1 do
             begin
                seek(f,bb);
                read(f,datom);
                if bb <> ll then
                begin
                   date := datom;
                   seek(tem,ttn);
                   write(tem,date);
                   ttn := ttn + 1;
                end;
             end;
               close(f);
               close(tem);
               erase(f);
               rename(tem,archivo);
            end;
         end;
      end;
 
 
 
  procedure marca_menu(m : integer);
  var
     t : integer;
  begin
      gotoxy(12,2);write('***** Menu Jeneral *****');
      gotoxy(12,3);write('ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ');
      for t := 1 to elmenu do
      begin
         if t <> m then
         begin
         textcolor(15);
         TextBackground(0);
         gotoxy(12,3 + t);write(menu_dato[t]);
         end
      else
         begin
           textcolor(15);
           TextBackground(5);
           gotoxy(12,3 + t);write(menu_dato[t]);
         end;
      end;
         textcolor(15);
         TextBackground(0);
         gotoxy(12,5 + elmenu);write('Elije Opcion Con ',chr(24),
                   ' ',chr(25),' O Numero Y Enter');
    end;
 
  procedure menu;
  var
    tec : char;
    opcion : integer;
    salir : boolean;
    cedu : longint;
  begin
     opcion := 1;
     salir := false;
  repeat
     clrscr;
     marca_menu(opcion);
     tec := readkey;
     if tec = #72 then
     begin
        opcion := opcion - 1;
        if opcion < 1 then
        opcion := 1;
     end;
     if tec = #80 then
     begin
        opcion := opcion + 1;
        if opcion > elmenu then
        opcion := elmenu;
     end;
  if tec in['1'..'7'] then
  begin
  case tec of
 '1' : opcion := 1;
 '2' : opcion := 2;
 '3' : opcion := 3;
 '4' : opcion := 4;
 '5' : opcion := 5;
 '6' : opcion := 6;
 '7' : opcion := elmenu;
   end;
  end;
  if tec = #13 then
  begin
    case opcion of
  1 : entada_datos_jugador;
  2 : begin
        clrscr;
        write('  Entre Num. Cedula : ');
        readln(cedu);
        Actualizar_jugador(cedu);
      end;
  3 : begin
        clrscr;
        write('   Entre Numero Cedula : ');
        readln(cedu);
        Consultar_jugador(cedu);
        readkey;
      end;
  4 : begin
        clrscr;
        write('   Entre Numero Cedula : ');
        readln(cedu);
        Modificar_datos(cedu);
      end;
  5 : begin
        clrscr;
        write('   Entre Numero Cedula : ');
        readln(cedu);
       Eliminar_jugador(cedu);
      end;
  6 :;
  elmenu : salir := true;
    end;
  end;
 
  until salir = true;
  end;
 
 
 
   begin
       textcolor(15);
       clrscr;
       pantalla_de_presentacion;
       clrscr;
       menu;
 
   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

AYUDA CON PROYECTO EN PASCAL POR FAVOOOOOOR!!!

Publicado por sandra (3 intervenciones) el 13/06/2014 04:53:23
tengo una duda a la hora de modificar solo encuentra el 1er jugador agregado no encontrara el 2do o el 3ro
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

AYUDA CON PROYECTO EN PASCAL POR FAVOOOOOOR!!!

Publicado por ramon (2158 intervenciones) el 14/06/2014 00:59:30
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
{Sustitulle este por el otro}
 
procedure Modificar_datos(bn : longint);
   var
     pp, dg : longint;
     datom : regjugador;
     sal, enco : boolean;
     nh : char;
   begin
     assign(f,archivo);
   {$I-} reset(f); {$I+}
    if ioresult <> 0 then
    begin
       writeln('   Error De Archivo pulsa Una Tecla');
       readkey;
    end
  else
     begin
        enco := false;
        for dg := 0 to filesize(f) - 1 do
        begin
           seek(f,dg);
           read(f,datom);
           if datom.cedula = bn then
           begin
              pp := dg;
              enco := true;
              break;
           end
        end;
          if enco = true then
          begin
             sal := false;
             repeat
                clrscr;
                writeln('   1 = Cedula');
                writeln('   2 = Nombre');
                writeln('   3 = Equipo Al Que Pertenece');
                writeln('   4 = Home Rounds Conectados');
                writeln('   5 = Bases Robadas');
                writeln('   6 = Carreras Impulsadas');
                writeln('   7 = Hits Conectados');
                writeln('   8 = Promedio De Bateo');
                writeln('   9 = Termina Modificacion ');
              repeat
                nh := readkey;
              until nh in['1','2','3','4','5','6','7','8','9'];
              clrscr;
       case nh of
 '1' : begin write('  cedula   : '); readln(datom.cedula); end;
 '2' : begin write('  nombre   : '); readln(datom.nombre_del_jugador); end;
 '3' : begin write('  equipo   : '); readln(datom.equipo_al_que_pertenece); end;
 '4' : begin write('  rounds   : '); readln(datom.home_rounds_conectados); end;
 '5' : begin write('  bases    : '); readln(datom.bases_robadas);   end;
 '6' : begin write('  carreras : '); readln(datom.carreras_impulsadas); end;
 '7' : begin write('  hits     : '); readln(datom.hits_conectados); end;
 '8' : begin write('  promedio : '); readln(datom.promedio_de_bateo); end;
 '9' : sal := true;
       end;
             until sal = true;
          end;
             seek(f,pp);
             write(f,datom);
             close(f);
          end;
      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

AYUDA CON PROYECTO EN PASCAL POR FAVOOOOOOR!!!

Publicado por sandra (3 intervenciones) el 14/06/2014 01:15:14
me dirías donde estaba el problema?
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

AYUDA CON PROYECTO EN PASCAL POR FAVOOOOOOR!!!

Publicado por sandra (3 intervenciones) el 14/06/2014 02:16:17
tengo otra duda me gustaria que me ayudaras a aclararla si puedes y no es mucha molestia claro esta....

si tienes algun correo donde te pueda enviar mensajes para preguntarte
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

AYUDA CON PROYECTO EN PASCAL POR FAVOOOOOOR!!!

Publicado por ramon (2158 intervenciones) el 14/06/2014 22:41:13
El fallo a sido mio tenia que ha ver quitado algo que pongo para probar fallo y me se paso es esto.

1
2
3
4
5
6
else
           begin
              writeln('  Codigo Cedula No Encontrado Pulse Una Tecla ');
              readkey;
              close(f);
           end;

Respecto a lo que comentas solo respondo en esta pregunta lo que necesites y si esta en mi mano te
responderé pero te aconsejo abras pregunta al ser nueva la veré antes, y disculpa no poder hacer mas.
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