I'm beginner. Making Purchase order system with problem in receipting

my only problem is how to make a receipt around this.
meals, snacks, and beverages are only in price, no specific food. and sorry for messy program, hehe.
Hope anyone thought this and help me with my problem

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
  #include<iostream>
#include<conio>
#include<process>
#include<dos>

char starT;
int pin,mode,order,meal,snack,beverage,receipt,snacK,bevE;
float total,total1,total2,total3,total4,total5,total6,total7,total8,pay,payment,change;
float total11,total12,total13,total14,total15;
float total111,total112,total113,total114,total115;
int i1,i2,i3,i4,i5,i6,i7,i8;
using namespace std;
int main()
{
clrscr();
cout<<"		   ******************************************"<<endl;
cout<<"		   *		        		    *"<<endl;
cout<<"		   *	       	 \"TAPSIHAN NI		    *"<<endl;
cout<<"		   *		  ALING BEBANG\"             *"<<endl;
cout<<"		   *					    *"<<endl;
cout<<"		   ******************************************"<<endl;
delay (1500);
cout<<"		   ******************************************"<<endl;
cout<<"		   *					    *"<<endl;
cout<<"		   *	       	  24 hours OPEN             *"<<endl;
cout<<"		   *	   \"PAIINITIN ANG IYONG ARAW,	    *"<<endl;
cout<<"		   *		ng AMING MAINIT		    *"<<endl;
cout<<"		   *		   na SABAW\"		    *"<<endl;
cout<<"		   *					    *"<<endl;
cout<<"		   ******************************************"<<endl;
delay(2500);
cout<<"		   ******************************************"<<endl;
cout<<"		   *		        		    *"<<endl;
cout<<"		   *	     \"Simulan na ang KAINAN\"	    *"<<endl;
cout<<"		   *		 			    *"<<endl;
cout<<"		   ******************************************"<<endl;
cout<<"			 	Continue?  [Y/N]\n";
cout<<"				--->|      ";
cin>>starT;
switch (starT)
{
case 'Y':
case 'y':
{
goto ab;
}
case 'N':
case 'n':
{
exit (0);
}
}
ab:
{
 clrscr();
 cout<<"\n				    Loading";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 }
 {
 clrscr();
 cout<<"\n				    Loading";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 }
 {
 clrscr();
 cout<<"\n				    Loading";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 }
a:
clrscr();
cout<<"		   ******************************************"<<endl;
cout<<"		   *		        		    *"<<endl;
cout<<"		   *	       	 ENTER PASSWORD             *"<<endl;
cout<<"		   *		 			    *"<<endl;
cout<<"		   ******************************************"<<endl;
cout<<"\n";
cout<<"\n";
cout<<"                   ---->|            ";
cin>>pin;
delay(500);
if (pin==12345)

{
b:
clrscr();
cout<<"		    ***************************************\n";
cout<<"		    *					  *\n";
cout<<"		    *              >  ORDER		  *\n";
cout<<"		    *		   >  PAYMENT		  *\n";
cout<<"		    *		   >  RECEIPT		  *\n";
cout<<"		    *					  *\n";
cout<<"		    ***************************************\n";
cout<<"\n\n";
cout<<"				GO or NOT? [1/0]\n";
cout<<"                   ---->|            ";
cin>>mode;

switch(mode)
{
case 1:
{
back:
f:
clrscr();
	cout<<"		    *****************************************\n";
	cout<<"		    *					    *\n";
	cout<<"		    *		    \"ORDER\"		    *\n";
	cout<<"		    *					    *\n";
	cout<<"		    *****************************************\n\n\n";
	cout<<"			    [1] MEALS       [3] BEVERAGES\n\n";
	cout<<"			    [2] SNACKS	    [0] EXIT\n";
	cout<<"			--->|          ";
cin>>order;

switch(order)
{
case 1:
{
clrscr();
	cout<<"		    ******************************************\n";
	cout<<"		    *					     *\n";
	cout<<"		    *		    \"MEALS\"		     *\n";
	cout<<"		    *					     *\n";
	cout<<"		    ******************************************\n\n\n";
	cout<<"			MENU:\n";
cout<<"				[1]30\n";
cout<<"				[2]30\n";
cout<<"				[3]25\n";
cout<<"				[4]25\n";
cout<<"				[5]25\n";
cout<<"				[6]25\n";
cout<<"				[7]15\n";
cout<<"				[8]5\n";
cout<<"					    [9]Back    [0]OK\n";
c:
cin>>meal;

switch(meal)
{
case 1:
{
cout<<"30\n";
total1=30;
i1=30;
goto c;
}
case 2:
{
cout<<"30\n";
total2=30;
i2=30;
goto c;
}
case 3:
{
cout<<"25\n";
total3=25;
i3=30;
goto c;
}
case 4:
{
cout<<"25\n";
total4=25;
i4=25;
goto c;
}
case 5:
{
cout<<"25\n";
total5=25;
i5=25;
goto c;
}
case 6:
{
cout<<"25\n";
total6=25;
i6=25;
goto c;
}
case 7:
{
cout<<"15\n";
total7=15;
i7=15;
goto c;
}
case 8:
{
cout<<"5\n";
total8=5;
i8=5;
goto c;
}
case 9:
{
goto f;
}
case 0:
{
payment:
clrscr();
	cout<<"		    ******************************************\n";
	cout<<"		    *					     *\n";
	cout<<"		    *		    \"PAYMENT\"		     *\n";
	cout<<"		    *					     *\n";
	cout<<"		    ******************************************\n";
cout<<"			How much is your money?\n";
cout<<"			";
cin>>payment;
total=total1+total2+total3+total4+total5+total6+total7+total8;
snacK=total11+total12+total13+total14+total15;
bevE=total111+total112+total113+total114+total115;
change=payment-total-snacK-bevE;
cout<<"Your change is "<<change<<".";
cout<<"\nEnter [1] to Print Receipt [0] if no need.\n";
cin>>receipt;
switch(receipt)
{
case 1:
{
clrscr();// here, I don't know to make the orders visible here. 
//and don't know to compute the total of the orders here in receipt
	cout<<"		    ******************************************\n";
	cout<<"		    *					     *\n";
	cout<<"		    *		    \"RECEIPT\"		     *\n";
	cout<<"		    *					     *\n";
	cout<<"		    ******************************************\n";
cout<<"			  Orders:\n";
goto end;
}
case 0:
{
goto end;
}
}
}

}
case 2:
{
clrscr();
	cout<<"		    ******************************************\n";
	cout<<"		    *					     *\n";
	cout<<"		    *		    \"SNACKS\"		     *\n";
	cout<<"		    *					     *\n";
	cout<<"		    ******************************************\n\n\n";
	cout<<"			MENU:\n";
cout<<"				[1]30\n";
cout<<"				[2]30\n";
cout<<"				[3]30\n";
cout<<"				[4]25\n";
cout<<"				[5]25\n";
cout<<"				     [6] BACK	 [0]OK\n";
d:
cin>>snack;
switch(snack)
{
case 1:
{
cout<<"30\n";
total11=30;
goto d;
}
case 2:
{
cout<<"30\n";
total12=30;
goto d;
}
case 3:
{
cout<<"30\n";
total13=30;
goto d;
}
case 4:
{
cout<<"30\n";
total14=25;
goto d;
}
case 5:
{
cout<<"30\n";
total15=25;
goto d;
}
case 6:
{
goto back;
}
case 0:
{
goto payment;
}
}

}
case 3:
{
clrscr();
	cout<<"		    ******************************************\n";
	cout<<"		    *					     *\n";
	cout<<"		    *		   \"BEVERAGES\"	     *\n";
	cout<<"		    *					     *\n";
	cout<<"		    ******************************************\n\n\n";
	cout<<"			MENU:\n";
cout<<"				[1]30\n";
cout<<"				[2]30\n";
cout<<"				[3]30\n";
cout<<"				[4]25\n";
cout<<"				[5]25\n";
cout<<"				       [6] BACK		[0]OK\n";
e:
cin>>beverage;
switch(beverage)
{
case 1:
{
cout<<"30\n";
total111=30;
goto e;
}
case 2:
{
cout<<"30\n";
total112=30;
goto e;
}
case 3:
{
cout<<"30\n";
total113=30;
goto e;
}
case 4:
{
cout<<"30\n";
total114=25;
goto e;
}
case 5:
{
cout<<"30\n";
total115=25;
goto e;
}
case 6:
{
goto back;
}
case 0:
{
goto payment;
}

}
}

}
}
case 0:
{
exit(0);
}

}

}











}
else if (pin==0)
{
exit(0);
}
else
{
cout<<"\n\n                                  INVALID PASSWORD!!";
 delay(500);
 {
 clrscr();
 cout<<"\n				    Going ";
 delay(500);
 cout<<"Back";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 }
 {
 clrscr();
 cout<<"\n				    Going ";
 delay(500);
 cout<<"Back";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 }
 {
 clrscr();
 cout<<"\n				    Going ";
 delay(500);
 cout<<"Back";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 delay(500);
 cout<<".";
 }
goto a;
}


end:
getch();
return(0);
}
closed account (48T7M4Gy)
You need to simplify your program and delete all the junk lines. That way you can concentrate on the real problems and forget about the delays and going ... if you get what I mean. You can throw out fromabout line 400 onwards unless you have areally good reason to keep it. Make a backup before you do though.

Also which machine have you got. Are you able to use something better (and free to download and use) than turbo c?
Ahm, Sir, I have codeblocks, but this semestrial, turbo c is the only one our prof had teach me.
about the delays, haha. I was doing that to make it look nicer beyond its messy codes haha. sorry sir.
But, sir can you teach me how to gather all the orders of the user, to compile to a receipt? thank you sir. hope you reply again and others too.
closed account (48T7M4Gy)
Yeah, OK. Best wishes with your order and receipt system. :)
closed account (48T7M4Gy)
http://www.cplusplus.com/forum/beginner/174994/
Ey, sir. Need some info. PLease help me in receipt system, still not solved. next day is my deadline for this, before finals.
Last edited on
Topic archived. No new replies allowed.