Pascal/Turbo Pascal - arreglo de registro y menu

 
Vista:

arreglo de registro y menu

Publicado por samuel (9 intervenciones) el 24/04/2013 05:25:30
buenas necesito hacer este trabajo por arreglo de registro

agradeceria su ayuda
La editorial "Ciencias e Ideas" ha implementado un procedimientode incentivo al personal de venta, el cual tiene las siguientes característic de ventasas:
1.- A cada vendedor se le asigna un objetivo de ventas y un factor de bonificación específico de acuerdo a su antiguedad.
2.- Los vendedores obtendrán bonificaciones adicionales a su sueldo básico, siempre y cuando las ventas realizadas superen a las ventas trazadas como objetivo.
3.- Las comisiones de ventas llamadas "COM" se calculan como un múltiplo del factor de bonificación "FB" de las ventas reales "VR" que excedan las cuotas, es decir el objetivo de ventas "OV".
4.- Al no cumplir con el objetivo de la venta, automáticamente la bonificación a pagar es cero.
5.- Si la venta real es mayor que el objetivo de venta, se paga bonificación por lo tanto COM= FB*(VR _ OV).
diseñar un algoritmo en pseudocódigo donde se muestre el uso correcto de las tecnicas de programación estructurada o subestructurada y realice lo siguiente:
- Presente un menú de mantenimiento con las opciones: INCLUIR, CONSULTAR, MODIFICAR, ELIMINAR, REPORTE Y SALIDA.
- Registre, con la opción incluir, los siguientes datos:
- Código del Vendedor
- Número de Cedula
- Nombres y Apellidos
- Número de Telefono
- Dirección
- Sueldo Básico
- Objetivo de Venta (OV)
- Factor Bonificación (FB)
- Venta Real (VR)
- Ordene el registro Vendedor por el número de Cédula
- Muestre por pantalla cuando realice una búsqueda de un vendedor (femenino o masculino) con un determinado "Codigo del Vendedor". toda la información relativa a ella o él.
- Genere por medio de la opción "Reporte" el siguiente diseño.
NOTA: EN LAS ALTERNATIVAS: " MODIFICAR,ELIMINAR Y CONSULTAR" HAGA USO DE LOS SIGUIENTES DATOS REGISTRADOS CON LA OPCION "INCLUIR"
" EDITORIAL LA CIENCIA Y EL UNIVERSO"
CODIGO DEL VENDEDOR NOMBRE Y APELLIDO BONIFICACION
999 X-------------------------X 9999999 ¡¡Felicitaciones!!
999 X-------------------------X 9999
999 X-------------------------X 999
999 X-------------------------X 0 ¡¡ No cumplió el objetivo!!
- Calcular de cada Vendedor su bonificación y determinar cuál es la mayor e imprimir un mensaje especial cuando este superada la venta o cuando no se cumple el objetivo.
- Subrutina que pewrmita ordenar las bonificaciones de mayor a menor, de tal forma que el primer registro a imprimir sea de mayor bonificación.
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

arreglo de registro y menu

Publicado por ramon (2158 intervenciones) el 29/04/2013 13:00:40
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
{Espero esto te ayude con tu labor}
 
program Ciencias_e_Ideas;
  uses
     crt;
  type
    personaldeventa = record
           CodVendedor : longint;
             NumCedula : longint;
            NombApelli : string[100];
              NumTelef : longint;
             Direccion : string[50];
             SuelBasic : real;
            ObjetVenta : real; {(OV)}
           FactBonific : real; {(FB)}
             VentaReal : real; {(VR)}
          end;
 
   const
      vend = 5;
  var
    datosvend : array[1..vend] of  personaldeventa;
    t, cont : integer;
    tec : char;
    com : real;
    bonifi : array[1..vend] of real;
    coven : longint;
 
  procedure incluir;
  begin
      clrscr;
      writeln('**** Entrada De Datos Del Vendedor ****');
      writeln;
      write('     Codigo Vendedor     : ');
      readln(datosvend[cont].CodVendedor);
      write('     Num. Cedula         : ');
      readln(datosvend[cont].NumCedula);
      write('     Nombre Apellido     : ');
      readln(datosvend[cont].NombApelli);
      write('     Num. Telefono       : ');
      readln(datosvend[cont].NumTelef);
      write('     Direccion           : ');
      readln(datosvend[cont].Direccion);
      write('     Sueldo Basico       : ');
      readln(datosvend[cont].SuelBasic);
      write('     Objetibo Venta      : ');
      readln(datosvend[cont].ObjetVenta);
      write('     Factor Bonificacion : ');
      readln(datosvend[cont].FactBonific);
   end;
 
   procedure consultar(codi : longint);
   var
     encontrado : boolean;
   begin
       encontrado := false;
       for t := 1 to cont do
       begin
          if datosvend[t].CodVendedor = codi then
          begin
            encontrado := true;
            break;
          end;
       end;
       if encontrado = true then
       begin
          clrscr;
          writeln('<<< Los Datos Consultados Son >>>');
          writeln;
          writeln('  Codigo Vendedor     = ',datosvend[t].CodVendedor);
          writeln('  Num. Cedula         = ',datosvend[t].NumCedula);
          writeln('  Nombre Apellido     = ',datosvend[t].NombApelli);
          writeln('  Num. Telefonico     = ',datosvend[t].NumTelef);
          writeln('  Direccion           = ',datosvend[t].Direccion);
          writeln('  Sueldo Basico       = ',datosvend[t].SuelBasic:0:2);
          writeln('  Objetivo Venta      = ',datosvend[t].ObjetVenta:0:2);
          writeln('  Factor Bonificacion = ',datosvend[t].FactBonific:0:2);
          writeln('  Venta Real          = ',datosvend[t].VentaReal:0:2);
          writeln;
          writeln('<<<<<< Pulse [Enter] >>>>>>>');
          readln;
       end
     else
        begin
           clrscr;
           writeln('  Error El Codigo Insertado No Esta Pulse [Enter]');
           readln;
        end;
   end;
 
  procedure modificar(codi : longint);
  var
    pul : char;
    modi : boolean;
  begin
     modi := false;
     for t := 1 to cont do
     begin
        if datosvend[t].CodVendedor = codi then
        begin
           modi := true;
           break;
        end;
     end;
      if modi = true then
      begin
         repeat
         clrscr;
         writeln('**** Modificacion De Datos ****');
         writeln;
         writeln('  1 = Codigo Vendedor');
         writeln('  2 = Num. Cedula');
         writeln('  3 = Nombre Apellido');
         writeln('  4 = Num. Telefonico');
         writeln('  5 = Direccion');
         writeln('  6 = Sueldo Basico');
         writeln('  7 = Objetivo Venta');
         writeln('  8 = Factor Bonificacion');
         writeln('  9 = finaliza');
         repeat
             pul := readkey;
         until pul in[#49..#57];
      case pul of
     #49 : begin
           write('  Codigo Vendedor     : ');
           readln(datosvend[t].CodVendedor);
           end;
     #50 : begin
           write('  Num. Cedula         : ');
           readln(datosvend[t].NumCedula);
           end;
     #51 : begin
           write('  Nombre Apellido     : ');
           readln(datosvend[t].NombApelli);
           end;
     #52 : begin
           write('  Num. Telefonico     : ');
           readln(datosvend[t].NumTelef);
           end;
     #53 : begin
           write('  Direccion           : ');
           readln(datosvend[t].Direccion);
           end;
     #54 : begin
           write('  Sueldo Basico       : ');
           readln(datosvend[t].SuelBasic);
           end;
     #55 : begin
           write('  Objetivo Venta      : ');
           readln(datosvend[t].ObjetVenta);
           end;
     #56 : begin
           write('  Factor Bonificacion : ');
           readln(datosvend[t].FactBonific);
           end;
      end;
    until pul = #57;
    end
   else
      begin
         clrscr;
         writeln('  Error El Codigo Insertado No Esta Pulse [Enter]');
         readln;
      end;
  end;
 
  procedure eliminar(codi : longint);
  var
    pul : char;
    borra : boolean;
    corre : integer;
  begin
     borra := false;
     for t := 1 to cont do
     if datosvend[t].CodVendedor = codi then
     begin
        borra := true;
        break;
     end;
     if borra = true then
     begin
        clrscr;
        writeln('<<<<<<<< Anular Registro Vendedor >>>>>>>>>>');
        writeln;
        writeln('  Codigo Vendedor     = ',datosvend[t].CodVendedor);
        writeln;
        writeln('Desea Anular Este Vendedor [S/N]');
        repeat
           pul := upcase(readkey);
        until pul in['S','N'];
        if pul = 'S' then
        begin
           fillchar(datosvend[t],sizeof(datosvend[t]),0);
           corre := 1;
           for corre := t to cont do
           if datosvend[corre].CodVendedor > 0 then
           begin
              datosvend[corre] := datosvend[corre - 1];
           end;
            cont := cont - 1;
        end;
     end
   else
      begin
         clrscr;
         writeln('  Error El Codigo Insertado No Esta Pulse [Enter]');
         readln;
      end;
  end;
 
  procedure reporteventas;
  begin
     clrscr;
     writeln('**** Reporte De Ventas Por Vendedor ****');
     writeln;
     for t := 1 to cont do
     begin
     write('  ',datosvend[t].CodVendedor,'  Venta Realizada : ');
     readln(datosvend[t].VentaReal);
     if datosvend[t].VentaReal > datosvend[t].ObjetVenta then
     begin
        bonifi[t] := (datosvend[t].VentaReal - datosvend[t].ObjetVenta) *
                                               datosvend[t].FactBonific;
     end;
   end;
  end;
 
  procedure  reporteresultados;
  var
    mensaje : string[3];
    mensaje1 : string[23];
  begin
    t := 1;
    mensaje := ' ';
  repeat
     clrscr;
     writeln('>>>>>> Reporte Resultados Por Vendedor <<<<<<<<');
     writeln;
      writeln('  CODIGO DEL VENDEDOR    NOMBRE Y APELLIDO    BONIFICACION');
      writeln('   ',datosvend[t].CodVendedor,'                     ',
      datosvend[t].NombApelli,'        ',bonifi[t]:0:2);
      if bonifi[t] > 0 then
      mensaje1 := 'Felicitaciones'
    else
      mensaje1 := 'No cumplio el objetivo';
      if t = cont then
      mensaje := 'Fin';
      writeln('   Pulse Una tecla  = ', mensaje,'      ? ',mensaje1,' ¨');
      readkey;
      t := t + 1;
   until t > cont;
  end;
 
  procedure ordenaarray(por : char);
  var
    temp : personaldeventa;
    g, r : integer;
    bontem : real;
  begin
     if upcase(por) = 'N' then  {Ordenado de menor a mayor codigo}
     begin
        for g := 1 to cont do
          for r := cont downto g + 1 do
          if datosvend[g].CodVendedor > datosvend[r].CodVendedor then
          begin
             temp := datosvend[g];
             datosvend[g] := datosvend[r];
             datosvend[r] := temp;
             bontem := bonifi[g];
             bonifi[g] := bonifi[r];
             bonifi[r] := bontem;
          end;
       end;
       if upcase(por) = 'B' then  {Ordenado de mayor a menor bonificacion}
       begin
          for g := 1 to cont do
            for r := cont downto g + 1 do
            if bonifi[g] < bonifi[r] then
            begin
               bontem := bonifi[r];
               bonifi[r] := bonifi[g];
               bonifi[g] := bontem;
               temp := datosvend[r];
               datosvend[r] := datosvend[g];
               datosvend[g] := temp;
            end;
       end;
   end;
 
  procedure menu;
  var
    tee : char;
    sas : boolean;
  begin
     sas := false;
   repeat
      clrscr;
      writeln('******* Menu General *********');
      writeln;
      writeln('   1 = INCLUIR');
      writeln('   2 = CONSULTAR');
      writeln('   3 = MODIFICAR');
      writeln('   4 = ELIMINAR');
      writeln('   5 = REPORTE VENTAS');
      writeln('   6 = REPORTE CONSULTAS');
      writeln('   7 = ORDENAR');
      writeln('   8 = SALIR');
      writeln;
      writeln('<<<<< Elija Opcion >>>>>');
      repeat
         tee := readkey;
      until tee in[#49..#56];
  case tee of
 #49 : begin
         clrscr;
         cont := cont + 1;
         if cont > vend then
         cont := vend;
         incluir;
        end;
 #50 : begin
          clrscr;
          write('   Entre Codigo Vendedor : ');
          readln(coven);
          consultar(coven);
       end;
 #51 : begin
          clrscr;
          write('   Entre Codigo Vendedor : ');
          readln(coven);
          modificar(coven);
       end;
 #52 : begin
          clrscr;
          write('   Entre Codigo Vendedor : ');
          readln(coven);
          eliminar(coven);
       end;
 #53 : begin
          clrscr;
          reporteventas;
       end;
 #54 : begin
         clrscr;
         reporteresultados;
       end;
 #55 : begin
          clrscr;
          writeln(' Ordenar Por [N] numero codigo y [B] por Bonificacion');
          repeat
             tec := upcase(readkey);
          until tec in['N','B'];
          ordenaarray(tec);
       end;
 #56 : sas := true;
   end;
   until sas = true;
  end;
 
 
   begin
       cont := 0;
       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

arreglo de registro y menu

Publicado por samuel (9 intervenciones) el 30/04/2013 04:42:10
gracias de verdad eres un genio ahora solo me falta ubicar esta formula en el programa:
COM=FB*(VR-OV)
YA QUE SI LA VENTA ES MAYOR QUE EL OBJETIVO DE VENTAS, SE PAGARA BONIFICACION
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

arreglo de registro y menu

Publicado por norelkis montero (1 intervención) el 18/05/2013 01:44:07
buenas tarde yo también estoy haciendo este trabajo, como hago el algoritmo haciendo uso de robustez. quisiera queme ayudaran gracias
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