Pascal/Turbo Pascal - Ramon necesito ayuda con unos programas... !!URGENTE!

 
Vista:

Ramon necesito ayuda con unos programas... !!URGENTE!

Publicado por Luis Elias (4 intervenciones) el 04/02/2013 01:19:11
Necesito ayuda con estos 3 ejercicios

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.

3. 2 puntos de ventas han vendido una cierta cantidad de productos. Estas ventas han sido registradas en los archivos de registros ’punto1.dat’ y ’punto2.dat’, donde cada archivo tiene la lista de productos vendidos. Cada registro de ambos archivos tiene la siguiente estructura: producto = RECORD identificador : integer; {1,2,3,4,5,6,7,8,9,10} precio : real; end; Existen 10 tipos de productos. Se pide leer ambos archivos, mostrar ganancias percibidas y mencionar cuál es el producto mas vendido, ambas cosas para cada punto de venta.

Si me puedes ayudar te lo agradezco.
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

Ramon necesito ayuda con unos programas... !!URGENTE!

Publicado por ramon (2158 intervenciones) el 06/02/2013 21:58:13
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

Ramon necesito ayuda con unos programas... !!URGENTE!

Publicado por ramon (2158 intervenciones) el 07/02/2013 18:19:56
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

Ramon necesito ayuda con unos programas... !!URGENTE!

Publicado por ramon (2158 intervenciones) el 03/08/2013 16:50:55
Siento mucho no poder ayudarle pero este lenguaje de programación no lo domino y no quiero
confundirlo lo siento.
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

Ramon necesito ayuda con unos programas... !!URGENTE!

Publicado por ramon (2158 intervenciones) el 04/08/2013 20:27:24
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
{Es pero que sea algo de esto lo que pides sino aclara términos mas precisos}
 program prestamos;
  uses
    crt;
  type
   rdatos = ^registdatos;
   registdatos = record
         Nombre : string;
         ntelefono : longint;
         Pais : string[110];
         Direccion : string[110];
         Estado : string[150];
         Edad : integer;
         aplicado : boolean;
         estCivil : char;
         prestamo : real;
         Duracion : integer;
         Ocupacion : string[120];
         IngresoMensual : real;
         sig : rdatos;
      end;
 
   const
      archivo : string = 'c:\tp\bin\temporal.bsd';
 
   var
     primer, actual, sigient : rdatos;
     f : file of registdatos;
     datos : registdatos;
     tecla : char;
 
   procedure tomadatosreg;
   var
     est : char;
   begin
       clrscr;
       gotoxy(30,2);write('***** Entrada De Datos *****');
       gotoxy(30,4);write('Nombre Completo       : ');
       gotoxy(30,5);write('Numero de Telefono    : ');
       gotoxy(30,6);write('Pais                  : ');
       gotoxy(30,7);write('Direccion             : ');
       gotoxy(30,8);write('Estado                : ');
       gotoxy(30,9);write('Edad                  : ');
      gotoxy(30,10);write('Ha Aplicado Antes     : ');
      gotoxy(30,11);write('Estado Civil          : ');
      gotoxy(30,12);write('Monto del Prestamo    : ');
      gotoxy(30,13);write('Duracion del Prestamo : ');
      gotoxy(30,14);write('Ocupacion             : ');
      gotoxy(30,15);write('Ingreso Mensual       : ');
      gotoxy(54,4);readln(datos.Nombre);
      gotoxy(54,5);readln(datos.ntelefono);
      gotoxy(54,6);readln(datos.Pais);
      gotoxy(54,7);readln(datos.Direccion);
      gotoxy(54,8);readln(datos.Estado);
      gotoxy(54,9);readln(datos.Edad);
      gotoxy(54,10);readln(est);
      if (est = 's') or (est = 'S') then
      datos.aplicado := true
    else
      datos.aplicado := false;
      gotoxy(54,11);readln(datos.estCivil);
      gotoxy(54,12);readln(datos.prestamo);
      gotoxy(54,13);readln(datos.Duracion);
      gotoxy(54,14);readln(datos.Ocupacion);
      gotoxy(54,15);readln(datos.IngresoMensual);
      actual^ := datos;
   end;
 
   procedure insertedatos;
   begin
       if primer = nil then
   begin
       new(actual);
       tomadatosreg;
       primer := actual;
       actual^.sig := nil;
      end
   else
      begin
          sigient := actual;
          new(actual);
          tomadatosreg;
          sigient^.sig := actual;
          actual^.sig := nil;
      end;
   end;
 
   procedure lintadoregistros;
   var
      ver : rdatos;
      i : integer;
   begin
       gotoxy(10,2);write('***** Presentacion Datos *****');
       gotoxy(10,4);write('Nombre Completo       : ');
       gotoxy(10,5);write('Numero de Telefono    : ');
       gotoxy(10,6);write('Pais                  : ');
       gotoxy(10,7);write('Direccion             : ');
       gotoxy(10,8);write('Estado                : ');
       gotoxy(10,9);write('Edad                  : ');
      gotoxy(10,10);write('Ha Aplicado Antes     : ');
      gotoxy(10,11);write('Estado Civil          : ');
      gotoxy(10,12);write('Monto del Prestamo    : ');
      gotoxy(10,13);write('Duracion del Prestamo : ');
      gotoxy(10,14);write('Ocupacion             : ');
      gotoxy(10,15);write('Ingreso Mensual       : ');
       ver := primer;
       while (ver <> nil) and (tecla <> #27) do
       begin
          with ver^ do
          begin
             gotoxy(34,4);write(Nombre);
             gotoxy(34,5);write(ntelefono);
             gotoxy(34,6);write(Pais);
             gotoxy(34,7);write(Direccion);
             gotoxy(34,8);write(Estado);
             gotoxy(34,9);write(Edad);
             gotoxy(34,10);write(aplicado);
             gotoxy(34,11);write(estCivil);
             gotoxy(34,12);write(prestamo:0:2);
             gotoxy(34,13);write(Duracion);
             gotoxy(34,14);write(Ocupacion);
             gotoxy(34,15);write(IngresoMensual:0:2);
          end;
          ver := ver^.sig;
          gotoxy(34,19);write('Desea Ver mas [S/N]');
          repeat
          tecla := upcase(readkey);
          until tecla in['S','N'];
          if tecla = 'N' then
          tecla := #27
        else
           begin
              for i := 1 to 12 do
              gotoxy(34,3 + i);clreol;
           end;
        end;
   end;
 
   procedure ejemplodatos;
   begin
       clrscr;
       gotoxy(10,2);write('***** Esto Es Un Ejemplo *****');
       gotoxy(10,4);write('Nombre Completo       : Antonino Martin Furia');
       gotoxy(10,5);write('Numero de Telefono    : 459856');
       gotoxy(10,6);write('Pais                  : Espa¤a');
       gotoxy(10,7);write('Direccion             : Olmedillo 20 I');
       gotoxy(10,8);write('Estado                : Castilla');
       gotoxy(10,9);write('Edad                  : 30');
      gotoxy(10,10);write('Ha Aplicado Antes     : N');
      gotoxy(10,11);write('Estado Civil          : C');
      gotoxy(10,12);write('Monto del Prestamo    : 23456');
      gotoxy(10,13);write('Duracion del Prestamo : 12');
      gotoxy(10,14);write('Ocupacion             : Soldador');
      gotoxy(10,15);write('Ingreso Mensual       : 1234');
      gotoxy(10,18);write('<<<<< Pulse Una Tecla >>>>>>');
      readkey;
      clrscr;
   end;
 
   procedure menu;
   var
     sal : boolean;
     tt : char;
   begin
      sal := false;
    repeat
        clrscr;
        gotoxy(20,1);write('***** Menu General *****');
        gotoxy(20,3);write(' 1 = Ver Ejemplo Entrada');
        gotoxy(20,4);write(' 2 = Entrar Datos');
        gotoxy(20,5);write(' 3 = Listar Datos');
        gotoxy(20,6);write(' 4 = Salir');
        gotoxy(20,9);write('<<< Elija Opcion >>>');
        repeat
        tt := readkey;
        until tt in['1','2','3','4'];
      case tt of
   '1' : ejemplodatos;
   '2' : insertedatos;
   '3' : begin if primer = nil then
         writeln('No Tiene Datos Actibos')
       else
         lintadoregistros;
       end;
   '4' : sal := true;
     end;
     until sal = true;
   end;
 
 
  begin
    primer := nil;
    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