Pascal/Turbo Pascal - Quie puede corregirme?

 
Vista:

Quie puede corregirme?

Publicado por YOSOYUNPRO (1 intervención) el 19/07/2017 17:51:46
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
program restaurant;
 
uses crt;
  //DECLARACIÓN DE CONSTANTES//
const
                          //precios de los productos//
 
    pre_hp_s =5000;                 //Precio de hamburgueza de pollo simple
    pre_hp_d =6000;                 //precio de hamburgueza de pollo doble
    pre_hc_s=4500;                  //precio de hamburgueza de carne simple
    pre_hc_d =5500;                 //precio de hamburgueza de carne doble
    pre_h_mixta=7000;               //precio de hamburgueza mixta
    pre_pc_n=2000;                  //precio de perro caliente normal
    pre_pc_j=3500;                  //precio de perro caliente jumbo
    pre_refresco=1500;              //precio de refresco
    pre_t_limon=1000;               //precio de te con limon
    pre_agua_mi=1000;               //precio de agua mineral
 
                 //Nombre de los productos//
    hp_s='Hamburgueza de pollo simple';
    hp_d='Hamburgueza de pollo doble';
    hc_s='Hamburgueza de carne simple';
    hc_d='Hamburgueza de carne doble';
    h_mixta='Hamburgueza mixta';
    pc_normal='Perro caliente normal';
    pc_jumbo='Perro caliente jumbo';
    refresco='Refresco';
    t_limon='Te con limon';
    agua='Agua mineral';
   //DECLARACIÓN DE VARIABLES//
var
    totalv:integer;                 //Dinero total de las ventas
 
    cont_totalv:integer;            //contador de las ventas
 
	cuenta_clien:integer;           //Cuenta a pagar por cada cliente
 
    totalv_hps:integer;             //Dinero total de hamburguezas de pollo simples vendidas
 
    cont_hps:integer;               //Cantidad de hamburguezas de pollo simples por cliente
 
    contotal_hps:integer;           //Cantidad total de hamburguezas de pollo simples vendidas
 
    totalv_hpd:integer;             //Dinero total de hamburguezas de pollo dobles
 
    cont_hpd:integer;               //Cantidad de hamburguezas de pollo doble por cliente
 
    contotal_hpd:integer;          //Cantidad total de hamburguezas de pollo dobles vendidas
 
    totalv_hcs:integer;             //Dinero total de hamburguezas de carne simples vendidas
 
    cont_hcs:integer;              //Cantidad de hamburguezas de carne simples por cliente
 
    contotal_hcs:integer;          //Cantidad total de hamburguezas de carne simples vendidas
 
    totalv_hcd:integer;             //Dinero total de hamburguezas de carne dobles vendidas
 
    cont_hcd:integer;              //Cantidad de hamburguezas de carne dobles por cliente
 
    contotal_hcd:integer;          //Cantidad total de hamburguezas de carne simples vendidas
 
    totalv_h_mix:integer;           //Dinero total de hamburguezas mixtas vendidas
 
    cont_h_mix:integer;             //Cantidad de hamburguezas mixtas por cliente
 
    cont_hamb:integer;              //Contador de todas las hamburguezas
 
    contotal_mix:integer;           //Cantidas de hamburguezas mixtas vendidas
 
    totalv_pcn:integer;             //Dinero total de perro calinte normal vendidos
 
    cont_pcn:integer;               //Cantidad de perros calientes normales por cliente
 
    contotal_pcn:integer;           //Cantidad total de perros calientes normales vendidos
 
    totalv_pcj:integer;             //Dinero total de perros calientes jumbo vendidos
 
    cont_pcj:integer;               //Cantidad de perros calientes jumbo por cliente
 
    contotal_pcj:integer;           //Cantidad total de perros calientes jumbo vendidos
 
    totalv_ref:integer;            //Dinero total de refrescos vendidos
 
    cont_refres:integer;           //Cantidad de refrescos por cliente
 
    contotal_ref:integer;          //Cantidad total de refrescos vendidos
 
    totalv_te:integer;             //Dinero total de té con limón vendido
 
    cont_te:integer;               //Cantidad de té con limón por cliente
 
    contotal_te:integer;           //Cantidad total de té con limón vendido
 
    totalv_agua:integer;           //Dinero total de agua mineral vendida
 
    cont_agua:integer;             //Cantidad de agua mineral por cliente
 
    contotal_agu:integer;          //Cantidad total de té con limón vendido
 
    cont_client:integer;           //contador de clientes
 
    client_desc:integer;           //contador de clientes con descuento
 
    totalv_desc:integer;           //contador de ventas con descuento
 
    opc:integer;                   //Opcion del menú principal
 
    Opc1:integer;                  //Opcion del menú secundario
 
    n_productos:integer;             //numero de productos que pide el cliente
 
    pedido:string[40];               //nombre del producto
 
    precio:integer;                  //precio del producto
 
    resp2:string[2];
 
    resp:string[2];                  //Respuesta (desea llevar otro producto?)
    a:integer;                       //contador de catidad de productos
 
    b,c,x,y:integer;                        //contadores y opciones
    descuento:integer;
 
BEGIN
                             //INICIALIZACION DE VARIABLES//
 
	totalv:=0;
	cont_totalv:=0;
 
	totalv_hps:=0;
	cont_hps:=0;
	contotal_hps:=0;
 
	totalv_hpd:=0;
	cont_hpd:=0;
	contotal_hpd:=0;
 
	totalv_hcs:=0;
	cont_hcs:=0;
	contotal_hcs:=0;
 
	totalv_hcd:=0;
	cont_hcd:=0;
	contotal_hcd:=0;
 
	client_desc:=0;
	totalv_desc:=0;
 
	totalv_h_mix:=0;
	cont_h_mix:=0;
	contotal_mix:=0;
 
	totalv_pcn:=0;
	cont_pcn:=0;
	contotal_pcn:=0;
 
	totalv_pcj:=0;
	cont_pcj:=0;
	contotal_pcj:=0;
 
	totalv_ref:=0;
	cont_refres:=0;
	contotal_ref:=0;
 
	totalv_te:=0;
	cont_te:=0;
	contotal_te:=0;
 
	totalv_agua:=0;
	cont_agua:=0;
	contotal_agu:=0;
 
	cont_client:=0;
	cont_hamb:=0;
	descuento:=0;
	writeln('Bienvenido al sistema de ventas');
	opc:=0;
	resp2:='oo';
 
repeat
	writeln('seleccione una opcion');
	write;
	writeln('1._Hacer un proceso de ventas');
	writeln('2._Visualizar los reportes de ventas');
	writeln('3._Salir');
	readln(opc);
if (opc<1) or (opc>3) then
begin
	writeln('Opcion inválida');
end;
	until (opc>=1) and  (opc<=3);
 
case opc of
 
1:begin
	opc1:=0;
	cont_client:=cont_client+1;
	cuenta_clien:=0;
	resp:='oo';
repeat
 
repeat
 
 
 
	writeln('Seleccione uno por uno los productos y la cantidad que desea llevar');
	write;
	writeln('1._Hamburgueza de pollo simple');
	writeln('2._Hamburgueza de pollo doble');
	writeln('3._Hamburgueza de carne simple');
	writeln('4._Hamburgueza de carne doble');
	writeln('5._Hamburgueza mixta');
	writeln('6._Perro caliente normal');
	writeln('7._Perro caliente jumbo');
	writeln('8._Refresco');
	writeln('9._Té con limón');
	writeln('10._Agua mineral');
	readln(opc1);
if (opc1<1) or (opc1>10) then
begin
	writeln('Opcion inválida');
end;
until(opc1>=1) and (opc1<=10);
case opc1 of
 
1: begin
	writeln('Cuantas hamburguezas de pollo simples desea llevar?');
	readln(cont_hps);
	cont_hamb:=cont_hamb+cont_hps;
	cuenta_clien:=cuenta_clien+(cont_hps*pre_hp_s);
	contotal_hps:=contotal_hps+cont_hps;
	totalv_hps:=totalv_hps+cont_hps*pre_hp_s;
 
	end;
2:begin
	writeln('Cuantas hamburguezas de pollo dobles desea llevar?');
	readln(cont_hpd);
	cont_hamb:=cont_hamb+cont_hpd;
	cuenta_clien:=cuenta_clien+(cont_hps*pre_hp_d);
	contotal_hpd:=contotal_hpd+cont_hpd;
	totalv_hpd:=totalv_hpd+cont_hpd*pre_hp_d;
	end;
3:begin
	writeln('Cuantas hamburguezas de carne simples desea llevar?');
	readln(cont_hcs);
	cont_hamb:=cont_hamb+cont_hcs;
	cuenta_clien:=cuenta_clien+(cont_hcs*pre_hc_s);
	contotal_hcs:=contotal_hcs+cont_hcs;
	totalv_hcs:=totalv_hcs+cont_hcs*pre_hc_s;
	end;
4:begin
	writeln('Cuantas hamburguezas de carne dobles desea llevar?');
	readln(cont_hcd);
	cont_hamb:=cont_hamb+cont_hcd;
	cuenta_clien:=cuenta_clien+(cont_hcd*pre_hc_d);
	contotal_hcd:=contotal_hcd+cont_hcd;
	totalv_hcd:=totalv_hcd+cont_hcd*pre_hc_d;
	end;
5:begin
	writeln('Cuantas hamburguezas mixtas desea llevar?');
	readln(cont_h_mix);
	cont_hamb:=cont_hamb+cont_h_mix;
	cuenta_clien:=(cont_h_mix*pre_h_mixta)+cuenta_clien;
	contotal_mix:=contotal_mix+cont_h_mix;
	totalv_h_mix:=totalv_h_mix+cont_h_mix*pre_h_mixta;
	end;
6:begin
	writeln('Cuantos perros calientes normales desea llevar?');
	readln(cont_pcn);
	cuenta_clien:=cuenta_clien+(cont_pcn*pre_pc_n);
	contotal_pcn:=contotal_pcn+cont_pcn;
	totalv_pcn:=totalv_pcn+cont_pcn*pre_pc_n;
	end;
7:begin
	writeln('Cuantos perros calientes jumbo desea llevar?');
	readln(cont_pcj);
	cuenta_clien:=cuenta_clien+(cont_pcj*pre_pc_j);
	contotal_pcj:=contotal_pcj+cont_pcj;
	totalv_pcj:=totalv_pcj+cont_pcj*pre_pc_j;
	end;
8:begin
	writeln('Cuantos refrescos desea llevar?');
	readln(cont_refres);
	cuenta_clien:=cuenta_clien+(cont_refres*pre_refresco);
	contotal_ref:=contotal_ref+cont_refres;
	totalv_ref:=totalv_ref+cont_refres*pre_refresco;
	end;
9:begin
	writeln('Cuantos té con limón desea llevar');
	readln(cont_te);
	cuenta_clien:=cuenta_clien+(cont_te*pre_t_limon);
	contotal_te:=contotal_te+cont_te;
	totalv_te:=totalv_te+cont_te*pre_t_limon;
	end;
10:begin
	writeln('Cuanta agua mineral desea llevar?');
	readln(cont_agua);
	cuenta_clien:=cuenta_clien+(cont_agua*pre_agua_mi);
	contotal_agu:=contotal_agu+cont_agua;
	totalv_agua:=totalv_agua+cont_agua*pre_agua_mi;
	end;
	end;
	writeln('Desea llevar otro producto?');
	readln(resp);
	until(resp='no')or(resp='NO');
clrscr;
writeln;
	write('Cliente N°',cont_client);
	writeln;
	writeln('Producto                             Cantidad                      Monto');
	if cont_hps>0 then
	begin
	writeln;
	writeln(hp_s,'                  '          ,cont_hps,'       ','x', '            ',pre_hp_s   );
	end;
	if cont_hpd>0 then
	begin
	writeln;
	writeln(hp_d,'                   '          ,cont_hpd,'       ','x', '            ',pre_hp_d);
	end;
	if cont_hcs>0 then
	begin
	writeln;
	writeln(hc_s,'                  '          ,cont_hcs,'       ', 'x','            ',pre_hc_s);
	end;
	if cont_hcd>0 then
	begin
	writeln;
	writeln(hc_d,'                   '          ,cont_hcd,'       ','x','            ',pre_hc_d);
	end;
	if cont_h_mix>0 then
	begin
	writeln;
	writeln(h_mixta,'                            ',cont_h_mix,'       ','x','            ',pre_h_mixta);
	end;
	if cont_pcn>0 then
	begin
	writeln;
	writeln(pc_normal,'                        ' ,cont_pcn, '       ','x','            ',pre_pc_n);
	end;
	if cont_pcj>0 then
	begin
	writeln;
	writeln(pc_jumbo,'                         ',cont_pcj, '       ','x','            ',pre_pc_j);
	end;
	if cont_refres>0 then
	begin
	writeln;
	writeln(refresco,'                                     ',cont_refres,'       ','x','            ',pre_refresco);
	end;
	if cont_te>0 then
	begin
	writeln;
	writeln(t_limon,'                                 ',cont_te,'       ','x','            ',pre_t_limon);
	end;
	if cont_agua>0 then
	begin
	writeln;
	writeln(agua,'                                 ',cont_agua,'       ','x','            ',pre_agua_mi);
	end;
 
writeln('________________________________________________________________________________');
writeln('                                                           ''Monto Bs.:',cuenta_clien);
if cont_hamb>6 then
begin
client_desc:=client_desc+1;
descuento:=(cuenta_clien*15)div 100;
writeln('                                                 ''Monto descuento Bs.:',descuento);
writeln('                                                     ''Monto total Bs.:',cuenta_clien-descuento);
totalv_desc:=totalv_desc+(cuenta_clien-descuento);
 
end
else
begin
totalv:=totalv+cuenta_clien;
end;
 
 
end;
 
 
2:
begin
clrscr;
writeln('Se atiendieron ',cont_client,' clientes');
writeln('Se les hizo descuento a ',client_desc,' clientes');
writeln;
writeln('Total de bolivares por venta de hamburguezas de pollo simples: ',totalv_hps);
writeln('Total de bolivares por venta de hamburguezas de pollo dobles:  ',totalv_hpd);
writeln('Total de bolivares por venta de hamburguezas de carne simples: ',totalv_hcs);
writeln('Total de bolivares por venta de hamburguezas de carne dobles:  ',totalv_hcd);
writeln('Total de bolivares por venta de hamburguezas mixtas: ',totalv_h_mix);
writeln('Total de bolivares por venta de perros calientes normales: ',totalv_pcn);
writeln('Total de bolivares por venta de perros calientes jumbo: ',totalv_pcj);
writeln('Total de bolivares por venta de refrescos: ',totalv_ref);
writeln('Total de bolivares por venta de té con limón: ',totalv_te);
writeln('Total de bolivares por venta de agua mineral: ',totalv_agua);
writeln;
writeln('Se obtuvieron ',totalv,' bolivares sin descuento');
writeln('Se obtuvieron ',totalv_desc,' bolivares con descuento');
if (contotal_hps>contotal_hpd) and (contotal_hps>contotal_hcs) and (contotal_hps>contotal_hcd) and (contotal_hps>contotal_mix) and (contotal_hps>contotal_pcn) and (contotal_hps>contotal_pcj) and (contotal_hps>contotal_ref) and (contotal_hps>contotal_te) and (contotal_hps>contotal_agu) then
begin
writeln('El producto mas vendido fue: ',hp_s,'con ',contotal_hps,' ventas!');
end;
if (contotal_hpd>cont_hps) and (contotal_hpd>contotal_hcs) and (contotal_hpd>contotal_hcd) and (contotal_hpd>contotal_mix) and (contotal_hpd>contotal_pcn) and (contotal_hpd>contotal_pcj) and (contotal_hpd>contotal_ref) and (contotal_hpd>contotal_te) and (contotal_hpd>contotal_agu) then
begin
writeln('El producto mas vendido fue: ',hp_d,' con ',contotal_hpd)
end;
end;
 
 
end;
 
end.
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

Quie puede corregirme?

Publicado por ramon (2158 intervenciones) el 10/08/2017 12:03:02
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
{Corregido Funciona Espero Sirva  }
 
program restaurant;
 
uses crt;
  {//DECLARACIÓN DE CONSTANTES//}
const
                          {//precios de los productos//*}

    pre_hp_s =5000;                 {//Precio de hamburgueza de pollo simple}
    pre_hp_d =6000;                 {//precio de hamburgueza de pollo doble}
    pre_hc_s=4500;                  {//precio de hamburgueza de carne simple}
    pre_hc_d =5500;                 {//precio de hamburgueza de carne doble}
    pre_h_mixta=7000;               {//precio de hamburgueza mixta}
    pre_pc_n=2000;                  {//precio de perro caliente normal}
    pre_pc_j=3500;                  {//precio de perro caliente jumbo}
    pre_refresco=1500;              {//precio de refresco}
    pre_t_limon=1000;               {//precio de te con limon}
    pre_agua_mi=1000;               {//precio de agua mineral}

                 {//Nombre de los productos//}
    hp_s='Hamburgueza de pollo simple';
    hp_d='Hamburgueza de pollo doble';
    hc_s='Hamburgueza de carne simple';
    hc_d='Hamburgueza de carne doble';
    h_mixta='Hamburgueza mixta';
    pc_normal='Perro caliente normal';
    pc_jumbo='Perro caliente jumbo';
    refresco='Refresco';
    t_limon='Te con limon';
    agua='Agua mineral';
   {//DECLARACIÓN DE VARIABLES//}
var
    totalv:integer;                 {//Dinero total de las ventas}

    cont_totalv:integer;            {//contador de las ventas}

	cuenta_clien:integer;           {//Cuenta a pagar por cada cliente}

    totalv_hps:integer;             {//Dinero total de hamburguezas de pollo simples vendidas}

    cont_hps:integer;               {//Cantidad de hamburguezas de pollo simples por cliente}

    contotal_hps:integer;           {//Cantidad total de hamburguezas de pollo simples vendidas}

    totalv_hpd:integer;             {//Dinero total de hamburguezas de pollo dobles }

    cont_hpd:integer;               {//Cantidad de hamburguezas de pollo doble por cliente}

    contotal_hpd:integer;          {//Cantidad total de hamburguezas de pollo dobles vendidas}

    totalv_hcs:integer;            { //Dinero total de hamburguezas de carne simples vendidas}

    cont_hcs:integer;              {//Cantidad de hamburguezas de carne simples por cliente}

    contotal_hcs:integer;          {//Cantidad total de hamburguezas de carne simples vendidas}

    totalv_hcd:integer;            { //Dinero total de hamburguezas de carne dobles vendidas}

    cont_hcd:integer;              {//Cantidad de hamburguezas de carne dobles por cliente}

    contotal_hcd:integer;          {//Cantidad total de hamburguezas de carne simples vendidas}

    totalv_h_mix:integer;           {//Dinero total de hamburguezas mixtas vendidas}

    cont_h_mix:integer;             {//Cantidad de hamburguezas mixtas por cliente}

    cont_hamb:integer;              {//Contador de todas las hamburguezas}

    contotal_mix:integer;           {//Cantidas de hamburguezas mixtas vendidas}

    totalv_pcn:integer;            { //Dinero total de perro calinte normal vendidos}

    cont_pcn:integer;               {//Cantidad de perros calientes normales por cliente}

    contotal_pcn:integer;          { //Cantidad total de perros calientes normales vendidos}

    totalv_pcj:integer;             {//Dinero total de perros calientes jumbo vendidos}

    cont_pcj:integer;               {//Cantidad de perros calientes jumbo por cliente}

    contotal_pcj:integer;           {//Cantidad total de perros calientes jumbo vendidos}

    totalv_ref:integer;            {//Dinero total de refrescos vendidos }

    cont_refres:integer;           {//Cantidad de refrescos por cliente}

    contotal_ref:integer;          {//Cantidad total de refrescos vendidos }

    totalv_te:integer;             {//Dinero total de té con limón vendido }

    cont_te:integer;               {//Cantidad de té con limón por cliente}

    contotal_te:integer;           {//Cantidad total de té con limón vendido}

    totalv_agua:integer;           {//Dinero total de agua mineral vendida}

    cont_agua:integer;             {//Cantidad de agua mineral por cliente}

    contotal_agu:integer;          {//Cantidad total de té con limón vendido}

    cont_client:integer;           {//contador de clientes}

    client_desc:integer;           {//contador de clientes con descuento}

    totalv_desc:integer;           {//contador de ventas con descuento}

    opc:integer;                   {//Opcion del menú principal}

    Opc1:integer;                  {//Opcion del menú secundario}

    n_productos:integer;             {//numero de productos que pide el cliente}

    pedido:string[40];               {//nombre del producto}

    precio:integer;                  {//precio del producto}

    resp2:string[2];

    resp:string[2];                  {//Respuesta (desea llevar otro producto?) }
    a:integer;                       {//contador de catidad de productos}

    b,c,x,y:integer;                        {//contadores y opciones}
    descuento:integer;

BEGIN
                             {//INICIALIZACION DE VARIABLES//}

	totalv:=0;
	cont_totalv:=0;

	totalv_hps:=0;
	cont_hps:=0;
	contotal_hps:=0;

	totalv_hpd:=0;
	cont_hpd:=0;
	contotal_hpd:=0;

	totalv_hcs:=0;
	cont_hcs:=0;
	contotal_hcs:=0;

	totalv_hcd:=0;
	cont_hcd:=0;
	contotal_hcd:=0;

	client_desc:=0;
	totalv_desc:=0;

	totalv_h_mix:=0;
	cont_h_mix:=0;
	contotal_mix:=0;

	totalv_pcn:=0;
	cont_pcn:=0;
	contotal_pcn:=0;

	totalv_pcj:=0;
	cont_pcj:=0;
	contotal_pcj:=0;

	totalv_ref:=0;
	cont_refres:=0;
	contotal_ref:=0;

	totalv_te:=0;
	cont_te:=0;
	contotal_te:=0;

	totalv_agua:=0;
	cont_agua:=0;
	contotal_agu:=0;

	cont_client:=0;
	cont_hamb:=0;
	descuento:=0;
	writeln('Bienvenido al sistema de ventas');
	opc:=0;
	resp2:='oo';

repeat
	writeln('seleccione una opcion');
	write;
	writeln('1._Hacer un proceso de ventas');
	writeln('2._Visualizar los reportes de ventas');
	writeln('3._Salir');
	readln(opc);
if (opc<1) or (opc>3) then
begin
	writeln('Opcion inválida');
end;
	until (opc>=1) and  (opc<=3);

case opc of

1:begin
	opc1:=0;
	cont_client:=cont_client+1;
	cuenta_clien:=0;
	resp:='oo';
repeat
 
repeat
 
 
 
	writeln('Seleccione uno por uno los productos y la cantidad que desea llevar');
	write;
	writeln('1._Hamburgueza de pollo simple');
	writeln('2._Hamburgueza de pollo doble');
	writeln('3._Hamburgueza de carne simple');
	writeln('4._Hamburgueza de carne doble');
	writeln('5._Hamburgueza mixta');
	writeln('6._Perro caliente normal');
	writeln('7._Perro caliente jumbo');
	writeln('8._Refresco');
	writeln('9._Té con limón');
	writeln('10._Agua mineral');

	readln(opc1);
if (opc1<1) or (opc1>10) then
begin
	writeln('Opcion inválida');
end;
until(opc1>=1) and (opc1<=10);
case opc1 of

1: begin
	writeln('Cuantas hamburguezas de pollo simples desea llevar?');
	readln(cont_hps);
	cont_hamb:=cont_hamb+cont_hps;
	cuenta_clien:=cuenta_clien+(cont_hps*pre_hp_s);
	contotal_hps:=contotal_hps+cont_hps;
	totalv_hps:=totalv_hps+cont_hps*pre_hp_s;
 
	end;
2:begin
	writeln('Cuantas hamburguezas de pollo dobles desea llevar?');
	readln(cont_hpd);
	cont_hamb:=cont_hamb+cont_hpd;
	cuenta_clien:=cuenta_clien+(cont_hps*pre_hp_d);
	contotal_hpd:=contotal_hpd+cont_hpd;
	totalv_hpd:=totalv_hpd+cont_hpd*pre_hp_d;
	end;
3:begin
	writeln('Cuantas hamburguezas de carne simples desea llevar?');
	readln(cont_hcs);
	cont_hamb:=cont_hamb+cont_hcs;
	cuenta_clien:=cuenta_clien+(cont_hcs*pre_hc_s);
	contotal_hcs:=contotal_hcs+cont_hcs;
	totalv_hcs:=totalv_hcs+cont_hcs*pre_hc_s;
	end;
4:begin
	writeln('Cuantas hamburguezas de carne dobles desea llevar?');
	readln(cont_hcd);
	cont_hamb:=cont_hamb+cont_hcd;
	cuenta_clien:=cuenta_clien+(cont_hcd*pre_hc_d);
	contotal_hcd:=contotal_hcd+cont_hcd;
	totalv_hcd:=totalv_hcd+cont_hcd*pre_hc_d;
	end;
5:begin
	writeln('Cuantas hamburguezas mixtas desea llevar?');
	readln(cont_h_mix);
	cont_hamb:=cont_hamb+cont_h_mix;
	cuenta_clien:=(cont_h_mix*pre_h_mixta)+cuenta_clien;
	contotal_mix:=contotal_mix+cont_h_mix;
	totalv_h_mix:=totalv_h_mix+cont_h_mix*pre_h_mixta;
	end;
6:begin
	writeln('Cuantos perros calientes normales desea llevar?');
	readln(cont_pcn);
	cuenta_clien:=cuenta_clien+(cont_pcn*pre_pc_n);
	contotal_pcn:=contotal_pcn+cont_pcn;
	totalv_pcn:=totalv_pcn+cont_pcn*pre_pc_n;
	end;
7:begin
	writeln('Cuantos perros calientes jumbo desea llevar?');
	readln(cont_pcj);
	cuenta_clien:=cuenta_clien+(cont_pcj*pre_pc_j);
	contotal_pcj:=contotal_pcj+cont_pcj;
	totalv_pcj:=totalv_pcj+cont_pcj*pre_pc_j;
	end;
8:begin
	writeln('Cuantos refrescos desea llevar?');
	readln(cont_refres);
	cuenta_clien:=cuenta_clien+(cont_refres*pre_refresco);
	contotal_ref:=contotal_ref+cont_refres;
	totalv_ref:=totalv_ref+cont_refres*pre_refresco;
	end;
9:begin
	writeln('Cuantos té con limón desea llevar');
	readln(cont_te);
	cuenta_clien:=cuenta_clien+(cont_te*pre_t_limon);
	contotal_te:=contotal_te+cont_te;
	totalv_te:=totalv_te+cont_te*pre_t_limon;
	end;
10:begin
	writeln('Cuanta agua mineral desea llevar?');
	readln(cont_agua);
	cuenta_clien:=cuenta_clien+(cont_agua*pre_agua_mi);
	contotal_agu:=contotal_agu+cont_agua;
	totalv_agua:=totalv_agua+cont_agua*pre_agua_mi;
	end;
	end;

	writeln('Desea llevar otro producto Salir = [NO]?');
	readln(resp);
	until(resp='no')or(resp='NO');
clrscr;
writeln;
	write('Cliente N°',cont_client);
	writeln;
	writeln('Producto                             Cantidad                      Monto');
	if cont_hps>0 then
	begin
	writeln;
	writeln(hp_s,'                  '          ,cont_hps,'       ','x', '            ',pre_hp_s   );
	end;
	if cont_hpd>0 then
	begin
	writeln;
	writeln(hp_d,'                   '          ,cont_hpd,'       ','x', '            ',pre_hp_d);
	end;
	if cont_hcs>0 then
	begin
	writeln;
	writeln(hc_s,'                  '          ,cont_hcs,'       ', 'x','            ',pre_hc_s);
	end;
	if cont_hcd>0 then
	begin
	writeln;
	writeln(hc_d,'                   '          ,cont_hcd,'       ','x','            ',pre_hc_d);
	end;
	if cont_h_mix>0 then
	begin
	writeln;
	writeln(h_mixta,'                            ',cont_h_mix,'       ','x','            ',pre_h_mixta);
	end;
	if cont_pcn>0 then
	begin
	writeln;
	writeln(pc_normal,'                        ' ,cont_pcn, '       ','x','            ',pre_pc_n);
	end;
	if cont_pcj>0 then
	begin
	writeln;
	writeln(pc_jumbo,'                         ',cont_pcj, '       ','x','            ',pre_pc_j);
	end;
	if cont_refres>0 then
	begin
	writeln;
	writeln(refresco,'                                     ',cont_refres,'       ','x','            ',pre_refresco);
	end;
	if cont_te>0 then
	begin
	writeln;
	writeln(t_limon,'                                 ',cont_te,'       ','x','            ',pre_t_limon);
	end;
	if cont_agua>0 then
	begin
	writeln;
	writeln(agua,'                                 ',cont_agua,'       ','x','            ',pre_agua_mi);
	end;
 
writeln('________________________________________________________________________________');
writeln('                                                           ''Monto Bs.:',cuenta_clien);
if cont_hamb>6 then
begin
client_desc:=client_desc+1;
descuento:=(cuenta_clien*15)div 100;
writeln('                                                 ''Monto descuento Bs.:',descuento);
writeln('                                                     ''Monto total Bs.:',cuenta_clien-descuento);
totalv_desc:=totalv_desc+(cuenta_clien-descuento);

end
else
begin
totalv:=totalv+cuenta_clien;
end;


end;


2:
begin
clrscr;
writeln('Se atiendieron ',cont_client,' clientes');
writeln('Se les hizo descuento a ',client_desc,' clientes');
writeln;
writeln('Total de bolivares por venta de hamburguezas de pollo simples: ',totalv_hps);
writeln('Total de bolivares por venta de hamburguezas de pollo dobles:  ',totalv_hpd);
writeln('Total de bolivares por venta de hamburguezas de carne simples: ',totalv_hcs);
writeln('Total de bolivares por venta de hamburguezas de carne dobles:  ',totalv_hcd);
writeln('Total de bolivares por venta de hamburguezas mixtas: ',totalv_h_mix);
writeln('Total de bolivares por venta de perros calientes normales: ',totalv_pcn);
writeln('Total de bolivares por venta de perros calientes jumbo: ',totalv_pcj);
writeln('Total de bolivares por venta de refrescos: ',totalv_ref);
writeln('Total de bolivares por venta de té con limón: ',totalv_te);
writeln('Total de bolivares por venta de agua mineral: ',totalv_agua);
writeln;
writeln('Se obtuvieron ',totalv,' bolivares sin descuento');
writeln('Se obtuvieron ',totalv_desc,' bolivares con descuento');
if (contotal_hps>contotal_hpd) and (contotal_hps>contotal_hcs) and (contotal_hps>contotal_hcd) and
(contotal_hps>contotal_mix) and (contotal_hps>contotal_pcn) and (contotal_hps>contotal_pcj) and (contotal_hps>contotal_ref) and
(contotal_hps>contotal_te) and (contotal_hps>contotal_agu) then
begin
writeln('El producto mas vendido fue: ',hp_s,'con ',contotal_hps,' ventas!');
end;
if (contotal_hpd>cont_hps) and (contotal_hpd>contotal_hcs) and (contotal_hpd>contotal_hcd) and (contotal_hpd>contotal_mix) and
(contotal_hpd>contotal_pcn) and (contotal_hpd>contotal_pcj) and (contotal_hpd>contotal_ref) and (contotal_hpd>contotal_te) and
(contotal_hpd>contotal_agu) then
begin
writeln('El producto mas vendido fue: ',hp_d,' con ',contotal_hpd)
end;
end;


end;
  writeln;
  writeln('  Pulse Una Tecla Para Salir');
  readkey;
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