-
Notifications
You must be signed in to change notification settings - Fork 1
/
wheels4wheels.c
2647 lines (2335 loc) · 56.4 KB
/
wheels4wheels.c
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
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include<string.h>
#include <stdlib.h>
#include <time.h>
#include<stdio.h>
#include<unistd.h>
#include<windows.h>
#include <conio.h>
int main();
int CID;
struct User
{
int ID;
char username[20];
char useremail[200];
char password[20];
char bookingmode[20];
char time[200];
char preference[200];
int amountpaid;
int cancel;
int CID;
};
struct co_info{
int flag;
int ID;
char carname[100];
char cname[100];
char add[100];
char purpose[200];
int mnum;
char pnum[11];
int d;
int m;
int y;
int de;
int me;
int ye;
int seats;
int price;
int rcount;
float review;
int CID;
};
void sortlowtohigh(int data[],int size){
int i,j,temp;
for (i =0; i < size; ++i)
{
for (j = i + 1; j < size; ++j)
{
if (data[i] > data[j])
{
temp = data[i];
data[i] = data[j];
data[j] = temp;
}
}
}
}
void sorthightolow(int data[],int size){
int i,j,temp;
for (i =0; i < size; ++i)
{
for (j = i + 1; j < size; ++j)
{
if (data[i] < data[j])
{
temp = data[i];
data[i] = data[j];
data[j] = temp;
}
}
}
}
void reviewhightolow(float data[],int size){
int i,j;
float temp;
for (i =0; i < size; ++i)
{
for (j = i + 1; j < size; ++j)
{
if (data[i] < data[j])
{
temp = data[i];
data[i] = data[j];
data[j] = temp;
}
}
}
}
void removeduplicate(int arr[],int size){
int i,j,k;
for(i=0; i<size; i++)
{
for(j=i+1; j<size; j++)
{
/* If any duplicate found */
if(arr[i] == arr[j])
{
/* Delete the current duplicate element */
for(k=j; k<size; k++)
{
arr[k] = arr[k + 1];
}
/* Decrement size after removing duplicate element */
size--;
/* If shifting of elements occur then don't increment j */
j--;
}
}
}
}
void reviewremoveduplicate(float arr[],int size){
int i,j,k;
for(i=0; i<size; i++)
{
for(j=i+1; j<size; j++)
{
/* If any duplicate found */
if(arr[i] == arr[j])
{
/* Delete the current duplicate element */
for(k=j; k<size; k++)
{
arr[k] = arr[k + 1];
}
/* Decrement size after removing duplicate element */
size--;
/* If shifting of elements occur then don't increment j */
j--;
}
}
}
}
int printstation(struct co_info car)
{
int flag=0;
printf("CarID: %d ",car.CID);
printf("CarName: %s\t ",car.carname);
printf("Car Type:%s\t",car.purpose);
printf("Model Year: %d\t ",car.mnum);
printf("Seating Capacity: %d\t ",car.seats);
printf("PricePerDay: %d\t ",car.price);
printf("Reviews: %f\n",car.review);
flag++;
return flag;
}
NameQuery(char choice[])
{
FILE *fp;
fp=fopen("owner.bin","rb");
int x=0;
struct co_info car;
char pref[100];
int i,flag;
printf("Write car name you prefer: ");
fflush(stdin);
gets(pref);
system("cls");
char input[10];
strcpy(input,"Wedding");
while(fread(&car,sizeof(struct co_info),1,fp))
{
if(strcmp(pref,car.carname)==0&&strcmp(choice,car.purpose)==0&&car.flag==0)
{
x=printstation(car);
}
}
fclose(fp);
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
ModelQuery(char choice[])
{
struct co_info car;
FILE *fp;
fp=fopen("owner.bin","rb");
int i,x=0,mod;
printf("Enter desired model year? ");
scanf("%d",&mod);
system("cls");
while(fread(&car,sizeof(struct co_info),1,fp))
{
if(mod==car.mnum&&strcmp(choice,car.purpose)==0&&car.flag==0)
{
x=printstation(car);
}
}
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
SeatingQuery(char choice[])
{
int mod;
FILE *fp;
struct co_info car;
fp=fopen("owner.bin","rb");
printf("Write number of seats you prefer: ");
scanf("%d",&mod);
system("cls");
int x=0;
while(fread(&car,sizeof(struct co_info),1,fp))
{
if(mod==car.seats&&strcmp(choice,car.purpose)==0&&car.flag==0)
{
x=printstation(car);
}
}
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
void NameBrowse(char choice[])
{
int x=0;
FILE *fp;
struct co_info car;
fp=fopen("owner.bin","rb");
system("cls");
while(fread(&car,sizeof(struct co_info),1,fp))
{
if(strcmp(car.purpose,choice)==0&&car.flag==0)
{
x=printstation(car);
}
}
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
void Modelbrowseearliesttorecent(char choice[])
{
FILE* ptr;
ptr=fopen("owner.bin","rb");
struct co_info read;
int count=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(choice,read.purpose)==0&&read.flag==0)
count++;
}
int sorted[count];
int i=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(choice,read.purpose)==0&&read.flag==0)
{
sorted[i]=read.mnum;
i++;
}
}
i=0;
sortlowtohigh(sorted,count);
removeduplicate(sorted,count);
fseek(ptr,0,SEEK_SET);
int x=0;
int j;
for (j=0;j<count;j++)
{
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(sorted[i]==read.mnum&&strcmp(choice,read.purpose)==0&&read.flag==0){
x=printstation(read);
}
}
fseek(ptr,0,SEEK_SET);
i++;
}
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
void Modelbrowserecenttoearliest(char choice[])
{
FILE* ptr;
ptr=fopen("owner.bin","rb");
struct co_info read;
int count=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(choice,read.purpose)==0&&read.flag==0)
count++;
}
fseek(ptr,0,SEEK_SET);
int c=0;
int sorted[count];
while(fread(&read,sizeof(struct co_info),1,ptr))
{
if(strcmp(choice,read.purpose)==0&&read.flag==0)
{
sorted[c]=read.mnum;
c++;
}
}
int x;
int i=0;
sorthightolow(sorted,count);
removeduplicate(sorted,count);
fseek(ptr,0,SEEK_SET);
int j;
for (j=0;j<count;j++){
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(sorted[i]==read.mnum&&strcmp(choice,read.purpose)==0&&read.flag==0){
x=printstation(read);
}
}
fseek(ptr,0,SEEK_SET);
i++;
}
if(x==0){
printf("No car Found\nreturning to main menu");
sleep(2);
main();
}
}
void SeatingcapacityLowesttoHighest(char choice[])
{
FILE* ptr;
ptr=fopen("owner.bin","rb");
struct co_info read;
int count=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(read.purpose,choice)==0&&read.flag==0)
count++;
}
int sorted[count];
fseek(ptr,0,SEEK_SET);
int c=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(read.purpose,choice)==0&&read.flag==0)
{
sorted[c]=read.seats;
c++;
}
}
int i=0,x=0;
sortlowtohigh(sorted,count);
removeduplicate(sorted,count);
fseek(ptr,0,SEEK_SET);
int j;
for (j=0;j<count;j++){
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(sorted[i]==read.seats&&strcmp(read.purpose,choice)==0&&read.flag==0)
{
printf("CarID: %d\t ",read.CID);
printf("CarName: %s\t ",read.carname);
printf("Model Year: %d\t ",read.mnum);
printf("Seating Capacity: %d\t ",read.seats);
printf("PricePerDay: %d\t ",read.price);
printf("Reviews: %f\n",read.review);
x++;
}
}
fseek(ptr,0,SEEK_SET);
i++;
}
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
void Seatingcapacityhighesttolowest(char choice[])
{
FILE* ptr;
ptr=fopen("owner.bin","rb");
struct co_info read;
int count=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(choice,read.purpose)==0&&read.flag==0)
count++;
}
fseek(ptr,0,SEEK_SET);
int c=0;
int sorted[count];
while(fread(&read,sizeof(struct co_info),1,ptr))
{
if(strcmp(choice,read.purpose)==0&&read.flag==0)
{
sorted[c]=read.seats;
c++;
}
}
int i=0,x=0;
sorthightolow(sorted,count);
removeduplicate(sorted,count);
fseek(ptr,0,SEEK_SET);
int j;
for (j=0;j<count;j++){
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(sorted[i]==read.seats&&strcmp(choice,read.purpose)==0&&read.flag==0){
x=printstation(read);
}
}
fseek(ptr,0,SEEK_SET);
i++;
}
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
void pricehightolow(char choice[])
{
FILE* ptr;
ptr=fopen("owner.bin","rb");
struct co_info read;
int count=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(choice,read.purpose)==0&&read.flag==0)
count++;
}
fseek(ptr,0,SEEK_SET);
int c=0;
int sorted[count];
while(fread(&read,sizeof(struct co_info),1,ptr))
{
if(strcmp(choice,read.purpose)==0&&read.flag==0)
{
sorted[c]=read.price;
c++;
}
}
int i=0,x=0;
sortlowtohigh(sorted,count);
removeduplicate(sorted,count);
fseek(ptr,0,SEEK_SET);
int j;
for (j=0;j<count;j++){
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(sorted[i]==read.price&&strcmp(choice,read.purpose)==0&&read.flag==0){
printf("CarID: %d\t ",read.CID);
printf("CarName: %s\t ",read.carname);
printf("Model Year: %d\t ",read.mnum);
printf("Seating Capacity: %d\t ",read.seats);
printf("PricePerDay: %d\t ",read.price);
printf("Reviews: %f\n",read.review);
x++;
}
}
fseek(ptr,0,SEEK_SET);
i++;
}
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
void pricelowtohigh(char choice[])
{
FILE* ptr;
ptr=fopen("owner.bin","rb");
struct co_info read;
int count=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(read.purpose,choice)==0&&read.flag==0)
count++;
}
int sorted[count];
fseek(ptr,0,SEEK_SET);
int c=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(read.purpose,choice)==0&&read.flag==0)
{
sorted[c]=read.price;
c=c+1;;
}
}
int i=0,x=0;
sortlowtohigh(sorted,count);
removeduplicate(sorted,count);
fseek(ptr,0,SEEK_SET);
int j;
for (j=0;j<count;j++){
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(sorted[i]==read.price&&strcmp(read.purpose,choice)==0&&read.flag==0)
{
printf("CarID: %d\t ",read.CID);
printf("CarName: %s\t ",read.carname);
printf("Model Year: %d\t ",read.mnum);
printf("Seating Capacity: %d\t ",read.seats);
printf("PricePerDay: %d\t ",read.price);
printf("Reviews: %f\n",read.review);
x++;
}
}
fseek(ptr,0,SEEK_SET);
i++;
}
if(x==0)
{
printf("No cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
void Reviews(char choice[])
{
FILE *ptr;
ptr=fopen("owner.bin","rb");
struct co_info read;
int count=0;
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(strcmp(choice,read.purpose)==0&&read.flag==0)
count++;
}
fseek(ptr,0,SEEK_SET);
int c=0;
float sorted[count];
while(fread(&read,sizeof(struct co_info),1,ptr))
{
if(strcmp(choice,read.purpose)==0&&read.flag==0)
{
sorted[c]=read.review;
c++;
}
}
int i=0,x=0;
reviewhightolow(sorted,count);
reviewremoveduplicate(sorted,count);
fseek(ptr,0,SEEK_SET);
int j;
for (j=0;j<count;j++){
while(fread(&read,sizeof(struct co_info),1,ptr)){
if(sorted[i]==read.review&&strcmp(choice,read.purpose)==0&&read.flag==0){
x=printstation(read);
}
}
fseek(ptr,0,SEEK_SET);
i++;
}
if(x==0)
{
printf("\nNo cars found,Returning to mainscreen.......");
sleep(2);
main();
}
}
char* getlocaltime(){
time_t ttime = time(0);
char* dt = ctime(&ttime);
return dt;
}
int card(int price)
{
char cardno[100];
int i=0,c=0;
printf("Enter your card no");
fflush(stdin);
gets(cardno);
for(i=0;i<strlen(cardno);i++)
{
if(cardno[i]>47&&cardno[i]<58)
{
c++;
}
}
if(c!=strlen(cardno))
{
printf("Invalid characters entered ");
return 0;
}
if(strlen(cardno)<6||strlen(cardno)>19)
{
printf("Invalid card no");
return 0;
}
i=0;
printf("Your credit card no is: ");
while(i<strlen(cardno))
{
if(i%4==0)
{
printf(" ");
}
printf("%c",cardno[i]);
i++;
}
printf("\nAmount to be withdrawed from your account is %d",price);
}
int payment (int price)
{
int mode,cash;
printf("\t\t\t\t Checkout");
printf("\nPress 1 if you want to pay card\n");
printf("\nPress 2 if you want to pay cash\n");
scanf("%d",&mode);
switch(mode)
{
case 1:
{
card(price);
break;
}
case 2:
{
printf("Enter amount of cash ");
scanf("%d",&cash);
if(cash>=price)
{
printf("change returned is %d\n",cash-price);
}
else {
printf("Insufficient money entered");
printf("\nre-directing to mainpage...");
sleep(2);
main();
return 0;
break;
}}
}
}
int Buy(struct User pass,int days,int price,char choice[])
{
fflush(stdin);
int ID;
printf("\nEnter ID of the car you want to rent from the above list: ");
scanf("%d",&CID);
system("cls");
printf("Finding your car....\n");
sleep(2);
FILE *p;
struct co_info car;
p=fopen("owner.bin","rb");
int i,flag=0,flag2=0;
for(i=0;i<3;i++)
{
fseek(p,0,SEEK_SET);
while(fread(&car,sizeof(struct co_info),1,p))
{
if(flag>0&&flag<3)
{
printf("Enter ID of the car you want to rent from the above list");
scanf("%d",&CID);
}
if(car.CID==CID)
{
if(strcmp(car.purpose,choice)==0)
{
printf("\t\t\t________________________________________________\n");
printf("\t\t\t The car you have picked is %s\n",car.carname);
price=price+days*car.price;
printf("Your total price is %d\n",price);
printf("\n_______________________________________________________\n");
printf("\n\n");
printf("Enter Y to confirm your order\nPress any other character to go back to main page\n");
char m[10];
fflush(stdin);
gets(m);
switch(strcmp(m,"Y")==0||strcmp(m,"y")==0)
{
case 1:
{
system("cls");
printf("Booking your Order........\n");
sleep(2);
printf("Congratulations your order has been confirmed!\n");
printf("You will now be guided towards our Invoice and Payment Details Area");
sleep(2);
FILE *fr;
fr=fopen("owner.bin","rb+");
struct co_info read;
while(fread(&read,sizeof(struct co_info),1,fr)){
if (read.CID==CID){
read.rcount++;
pass.CID=read.CID;
fseek(fr,-sizeof(struct co_info),SEEK_CUR);
fwrite (&read, sizeof(struct co_info), 1, fr);
break;
}
}
return price;
break;
}
default:
{
main();
break;
}
}
}
else
{
printf("Your car is not listed in %s category and is not available for your uses please enter again\n");
flag++;
}
flag2++;
continue;
}
if(flag>3||flag2>3)
{
printf("We apologize for the inconvience\nNo cars found\n Exiting program......");
char c=getchar();
sleep(2);
exit(0);
}
}
}
}
void filter(int choice,char pref[] )
{
switch(choice)
{
case 1:
{
sleep(2);
system("cls");
NameQuery(pref);
break;
}
case 2:
{
sleep(2);
system("cls");
ModelQuery(pref);
break;
}
case 3:
{
sleep(2);
system("cls");
SeatingQuery(pref);
break;
}
case 4:
{
sleep(2);
system("cls");
NameBrowse(pref);
break;
}
case 5:
{
sleep(2);
system("cls");
Modelbrowserecenttoearliest(pref);
break;
}
case 6:
{
sleep(2);
system("cls");
Modelbrowseearliesttorecent(pref);
break;
}
case 7:
{
sleep(2);
system("cls");
SeatingcapacityLowesttoHighest(pref);
break;
}
case 8:
{
sleep(2);
system("cls");
Seatingcapacityhighesttolowest(pref);
break;
}
case 9:
{
sleep(2);
system("cls");
pricehightolow(pref);
break;
}
case 10:
{
sleep(2);
system("cls");
pricelowtohigh(pref);
break;
}
case 11:
{
sleep(2);
system("cls");
Reviews(pref);
break;
}
default:
{
printf("Invalid character");
break;
}
}
}
int wedding(struct User pass,int price,char choice [])
{
struct co_info W;
printf("Loading Packages....");
int i;
sleep(2);
int Budget=3000,Normal=5000,Luxury=8000,Custom;
printf("\nPlease specify what kind of package would you like\n1)Budget\n2)Normal\n3)Luxury\n4)Custom\n");
scanf("%d",&i);
switch (i)
{
case 1:
{
printf("You have selected the Budget package\nYour bill for decorations is %d Rs",Budget);
price= price+Budget;
break;
}
case 2:
{
printf("You have selected the Normal package\nYour bill for decorations is %d Rs",Normal);
price= price+Normal;
break;
}
case 3:
{
printf("You have selected the Luxury package\nYour bill for decorations is %d Rs",Luxury);
price = price+Luxury;
break;
}
case 4:
{
int flowers=3000,ribbons=2500,j;
printf("If you would like flowers only press 1\nIf you would like ribbons only press 2\n If you would like both press 3");
scanf("%d",&j);
switch(j)
{
case 1:
{
printf("You have selected the flowers only custom package\nYour bill for decorations is %d Rs\n",flowers);
price = price+flowers;
break;
}
case 2:
{
printf("You have selected the ribbons only custom package\nYour bill for decorations is %d Rs\n",ribbons);
price = price+ribbons;
break;
}
case 3:
{
printf("You have selected the flowers and ribbons only custom package\nYour bill is %d Rs",flowers+ribbons);
price = price+(flowers+ribbons);
break;
}
default:
{
char k;
printf("Invalid character entered\nIf you would like to exit press 0 or any other character\nIf you would like to go back to main wedding page press 1\n");
scanf("%c",&k);
switch(k)
{
case '1':
{
wedding(pass,price,choice);
}
default:
{
return 0;
}
}
}
}
break;
}
default:
{ int k;
printf("Invalid character entered\nIf you would like to exit press 0 or any other character\nIf you would like to go back to main wedding page press 1\n");
scanf("%d",&k);
switch(k)
{
case 1:
{
wedding(pass,price,choice);
}
default:
{
return 0;
}
}
}
}
fflush(stdin);
sleep(3);
system("cls");
printf("\t\t\t\t Welcome to The Wedding Section of Wheels for Wheels");
printf("\nPress the following keys for your desired method of filtering ");
printf("\n1,For searching for cars with a particular Model name.\n");
printf("2,For searching for cars with a particular Model year.\n");
printf("3,For searching for cars with a particular Seating capacity.\n");
printf("4,For browsing all cars randomly by Model Name.\n");
printf("5,For browsing all cars by Model year recent to earliest.\n");
printf("6,For browsing all cars by Model year earliest to recent.\n");
printf("7,For browsing all cars by Seating Capacity Lowest to Highest.\n");
printf("8,For browsing all cars by Seating Capacity Highest to Lowest.\n");
printf("9,For browsing all cars by Pricing Highest to Lowest.\n");
printf("10,For browsing all cars by Pricing Lowest to Highest.\n");
printf("11,For browsing all cars by their Owner's reviews\n");
scanf("%d",&i);
filter(i,choice);
fflush(stdin);
char ch;
printf("\n__________________________________________________________________ \n");
printf("If you want to rent a car Press 1\n");
printf("If you want to go back to main menu any other character\n");
scanf("%c",&ch);
switch(ch)
{
case '1':
{
int day=1;
price= price+ Buy(pass,day,price,choice);
break;