Pascal/Turbo Pascal - Necesito ayuda Urgente!!!!

 
Vista:

Necesito ayuda Urgente!!!!

Publicado por Luis (4 intervenciones) el 05/02/2013 20:47:30
1. Crear una estructura capaz de gestionar las cuentas corrientes de los clientes de un banco, sabiendo que como máximo puede haber 1000 clientes y tener cada cliente tres cuentas como máximo. La información que deberá contener será: Código cliente, Titular, Nº de cuenta (8 dígitos) y Saldo. Además se deberán crear un procedimiento Modificar que dados la estructura anterior, el código, el nº de cuenta y una cantidad, permita actualizar el saldo respecto a la cantidad indicada y a la cuenta de ese cliente. Al finalizar el año, cada cuenta recibe un incremento del 0,5% del saldo de la cuenta en concepto de intereses, por lo que habrá que realizar un módulo Intereses que actualice toda la estructura anterior y devuelva los costos (gasto total) que tendrá que asumir el banco en concepto de intereses.

2. Desarrollar un programa que controle la demanda de textos en una biblioteca, para ello se registrara cada libro, el titulo del libro, cantidad de ejemplares en la biblioteca y el numero de veces que fue prestado en el mes. Considerando que el numero de textos a estudiar no exceden de 250, codifique el programa para que además permita generar un listado de forma descendente de acuerdo al numero de ejemplares. Los cuales deben almacenarse en un archivo de tipo datos. En el cual podrán realizarse modificaciones recibiendo como parámetro el código del libro así como la generación de un archivo donde se almacene un reporte mensual de los prestamos realizados en la biblioteca el cual contendrá el código del libro, titulo, autor, cantidad de veces prestados y nombre de las personas que lo usaron.
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

Necesito ayuda Urgente!!!!

Publicado por ramon (2158 intervenciones) el 06/02/2013 21:57:03
Mira la estructura que pides se tendría que manejar con punteros puesto que ocupa mucho
mira lo.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
program banca;
 uses
   crt;
  type
 regcuenta = record
    codigo : string[25];
    nombre : string[120];
    cuenta : longint;
    saldo  : real;
  end;
 
 
  var
    cliente : array[1..10] of regcuenta;
 
 
    begin
        clrscr;
        writeln('    ',sizeof(regcuenta) * 1000,' bytes ');
        readln;
    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

Necesito ayuda Urgente!!!!

Publicado por Luis (4 intervenciones) el 06/02/2013 22:25:13
Y el segundo como seria?
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

Necesito ayuda Urgente!!!!

Publicado por ramon (2158 intervenciones) el 07/02/2013 18:14:20
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
{Así te quedaría el programa 1 con array}
 
program banca;
 {$N+}{$M 65000,0,650000}
 uses
    crt;
 type
   cliente = record
        Codigo  : word;
        Titular : string;
        Ncuenta : longint;
        Saldo   : double;
      end;
  const
      max = (64000 div sizeof(cliente));
      ianu = 0.5;
  var
    control : array[1..max] of cliente;
    enu1, enu2, cont : integer;
 
 
  procedure pantallaentradas;
  begin
     clrscr;
     gotoxy(5,1);write('*** Entrada Cliente Max Entradas : ',max - cont,' ***');
     gotoxy(10,3);write('Codigo    : ');
     gotoxy(10,4);write('Titular   : ');
     gotoxy(10,5);write('N§ Cuenta : ');
     gotoxy(10,6);write('Saldo     : ');
     gotoxy(22,3);readln(control[cont].Codigo);
     gotoxy(22,4);readln(control[cont].Titular);
     gotoxy(22,5);readln(control[cont].Ncuenta);
     gotoxy(22,6);readln(control[cont].Saldo);
  end;
 
  function buscaw(col : word) : word;
  var
     t : integer;
  begin
      for t := 1 to cont - 1 do
      if control[t].Codigo = col then
      begin
         buscaw := control[t].Codigo;
         enu1 := t;
         break;
      end
    else
       buscaw := 0;
  end;
 
  function buscal(col : longint) : longint;
  var
    t : integer;
  begin
      for t := 1 to cont - 1 do
      if control[t].Ncuenta = col then
      begin
         buscal := control[t].Ncuenta;
         enu2 := t;
         break;
      end
    else
       buscal := 0;
  end;
 
  procedure actualizarcuenta;
  var
     codi : word;
     ncue : longint;
     ingre : double;
     estad : boolean;
  begin
     clrscr;
     gotoxy(5,1);write('*** Modicacion Cuenta ***');
     gotoxy(10,3);write('Codigo    : ');
     gotoxy(10,4);write('N§ Cuenta : ');
     gotoxy(10,5);write('Ingreso   : ');
     gotoxy(22,3);readln(codi);
     estad := true;
     if buscaw(codi) = codi then
     begin
     gotoxy(22,4);readln(ncue);
     estad := false;
     end;
     estad := true;
     if buscal(ncue) = ncue then
     begin
     estad := false;
     gotoxy(22,5);readln(ingre);
     end;
     if estad = true then
     begin
     gotoxy(10,7);write('<<<<< Datos Erroneos Pulse [enter] >>>>>>');
     end
   else
      begin
       if enu1 = enu2 then
       control[enu1].Saldo := control[enu1].Saldo + ingre;
       gotoxy(10,7);write('Su Saldo Actual Es : ',control[enu1].Saldo:12:3);
       gotoxy(10,9);write('<<< Pulse [Enter] >>>');
       readln;
      end;
  end;
 
  procedure actualizarciclo;
  var
    t : integer;
    increm : double;
  begin
     clrscr;
     for t := 1 to cont - 1 do
     begin
    control[t].Saldo := control[t].Saldo + (control[t].Saldo * ianu / 100);
    writeln('   ',control[t].titular,'  El Saldo Actual Es : ',control[t].Saldo:12:3);
     end;
     writeln;
     writeln('<<< Pulse [Enter] >>>');
     readln;
  end;
 
  procedure menu;
  var
    ter, tec : char;
    sal : boolean;
  begin
      sal := false;
    repeat
       clrscr;
       writeln('****** Menu General ******');
       writeln;
       writeln('   1 = Entrada Cliente');
       writeln('   2 = Ingreso Cliente');
       writeln('   3 = Ajuste A¤o');
       writeln('   4 = Salir');
       writeln;
       writeln('<<<<< Elija Opcion >>>>>>');
       repeat
          tec := readkey;
       until tec in[#49..#52];
   case tec of
 #49 : begin
       clrscr;
       repeat
           pantallaentradas;
           write('Desea Entrar Mas Datos [S/N]');
           ter := readkey;
           if ter in['s','S'] then
           clrscr;
           cont := cont + 1;
           if cont > max then
           cont := max;
       until ter in['n','N'];
       end;
 #50 : begin
       clrscr;
       actualizarcuenta;
       end;
 #51 : begin
          clrscr;
          actualizarciclo;
       end;
 #52 : sal := true;
    end;
    until sal = true;
  end;
 
  begin
      clrscr;
      cont := 1;
      menu;
  end.
 
{Así el dos}
 
 program biblioteca;
 {$M 65000,0,650000}
 uses
    crt;
  type
    libro = record
        codigo : longint;
        titulo : string[125];
       nlibros : integer;
         autor : string[125];
      end;
 
  const
     archivo1 : string = 'reglibro.dat';
     archivo2 : string = 'prestamo.dat';
     maxlib = (64000 div sizeof(libro) div 2);
 
   type
   aquien = record
            nombre : string;
            end;
 
   prestamos = record
         codigo : longint;
         titulo : string[125];
          autor : string[125];
      prestados : aquien;
     end;
 
 
   var
      los_libros : array[1..maxlib] of libro;
      f1 : file of libro;
      prestamo : prestamos;
      f2 : file of prestamos;
      cont1 : integer;
 
 
  procedure entradadatos;
  var
    i : integer;
    tec : char;
    t : word;
  begin
    repeat
      clrscr;
      gotoxy(5,2);write('**** Entrada Datos Libros Maximos = ',maxlib,' ****');
      gotoxy(10,4);write('Codogo Num    : ');
      gotoxy(10,5);write('Titulo        : ');
      gotoxy(10,6);write('Num De Libros : ');
      gotoxy(10,7);write('Autor         : ');
      gotoxy(26,4);readln(los_libros[cont1].codigo);
      gotoxy(26,5);readln(los_libros[cont1].titulo);
      gotoxy(26,6);readln(los_libros[cont1].nlibros);
      gotoxy(26,7);readln(los_libros[cont1].autor);
      cont1 := cont1 + 1;
      if cont1 > maxlib then
      cont1 := maxlib;
      gotoxy(5,9);write('Desea Entrar Mas Libros [S/N]');
      repeat
           tec := readkey;
      until tec in['s','S','n','N'];
   until tec in['n','N'];
   assign(f1,archivo1);
 {$I-} reset(f1); {$I+}
    if ioresult <> 0 then
    begin
        rewrite(f1);
        for i := 1 to cont1 - 1 do
        begin
        seek(f1,i - 1);
        write(f1,los_libros[i]);
        end;
        close(f1);
    end
 else
    begin
        t := 1;
        for i := filesize(f1) to (filesize(f1) + cont1 - 1) do
        begin
        seek(f1,i);
        write(f1,los_libros[t]);
        t := t + 1;
        end;
    end;
  end;
 
  procedure listadodescendente;
  var
    t, l : integer;
    temp : libro;
   begin
       if cont1 - 1 > 1 then
       begin
          for t := 1 to cont1 - 1 do
            for l := cont1 to t do
            begin
             if los_libros[t].nlibros < los_libros[l].nlibros then
             begin
                 temp := los_libros[l];
                 los_libros[l] := los_libros[t];
                 los_libros[t] := temp;
             end;
          end;
           for t := 1 to cont1 - 1 do
           writeln(los_libros[t].codigo,'   ',los_libros[t].titulo,'   ',
           los_libros[t].nlibros,'   ',los_libros[t].autor);
           writeln;
           writeln('Pulse [Enter]');
           readln;
       end
     else
        begin
           writeln(los_libros[cont1 - 1].codigo,'   ',
           los_libros[cont1 - 1].titulo,'   ',los_libros[cont1 - 1].nlibros,
           '   ',los_libros[cont1 - 1].autor);
           writeln;
           writeln('Pulse [Enter]');
           readln;
        end;
   end;
 
 
  begin
     clrscr;
     entradadatos;
 
  end.
 
{Fíjate en los datos que te permite el sistema en ambos programas}
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