Question: Question 1 #include #include #include #define SIZE 11 //only have 50 car int n = 0; int front = 0; int rear -1; int count



![char Place[100]; char Type(100); char Seat[10]; char Brand[100]; char Tranmission (100); char](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f04e3de0afc_70166f04e3d7165d.jpg)
![RentalType(100); float Price; }; struct Car searchListcar(100); struct Booking char date[10]; char](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f04e3e7eda6_70266f04e3e1c7d8.jpg)
![time[10); struct Car car, }[3]; struct Customer char Name(100); char IC(20); char](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f04e3f1e5a6_70266f04e3eba93b.jpg)
Question 1 #include #include #include #define SIZE 11 //only have 50 car int n = 0; int front = 0; int rear -1; int count = 0; void searchCar(char*,char*); void pop(); void updateProfile(); struct Cart char Place[100]; char Type(100); char Seat[10]; char Brand[100]; char Tranmission (100); char RentalType(100); float Price; }; struct Car searchListcar(100); struct Booking char date[10]; char time[10); struct Car car, }[3]; struct Customer char Name(100); char IC(20); char Phone(20); char Email(100); float totalPrice; }cus; struct Car cd[SIZE] = { ("Rompin","Proton","4","Iriz","Auto","full",50), ("Pekan","Perodua","6","Alza", "Auto","half",75), }; void displayCatalogue(struct Car cd(11), ints) inti: printf(" Place\tCar Type\tSeat\tBrand\tTransmission\tHour\tPrice "); for (i = 0; i n-1); choice = choice - 1; b(rear).car = searchListcar(choice); count++; /bookingInfo) void searchCar(char *key, char *place) int i; n=0; - SIZE - 1; printf(" \t** LIST OF AVAILABLE CAR **"); printf(" NUMBER\tPLACE\tCAR TYPE\tSEAT\tBRAND\tTRANMISSION\tHOUR\tPRICE "); whileli >= 0) if(strcmp(cd[i].Seat,key) == 0) if(strcmp(cd[i].Place,place) == 0){ searchListcar(n) = cd to: printf" %d\t%s\t%s\t\t%s\t%s\t%s\t\t%s\t%f ", n+1,cd[i].Place, cd[i].Type, cd[i].Seat.cd[i]. Brand, cd[i]. Tranmission,cd[i]. RentalType.cd[i].Price); } 1 //reduce the size of array for searching } 1/searchSeat() void cusinfo printf(" - REGISTER printf(" NICKNAME: "); scanf("%s",&cus. Name); printf(" IC: "); scanf("%s",&cus.IC); printf(" PHONE NUMBER: "); scanf("%s",&cus.Phone); printf(" EMAIL :"); scanf("%s",&cus. Email); printf(" -YOUR BOOKING IS SUCCESSFULL..."); ://customer Info() void booking Menu intx dol printf(" \t1 . ADD BOOKING \t2.CANCEL BOOKING \t3.UPDATE PROFILE \t4.EXIT \tYour choice: "); scanf("%d",&x); switch(x) case 1: Iffcount == 3){printf(" LIMIT TO 3 BOOKING ONLY ");break;) bookinginfo(); printf(" - ......YOUR BOOKING IS SUCCESSFULL"); break; case 2: pop();break; case 3: updateProfile();break; case 4: break; default: printf(" \t Please enter a Valid Choice (1/2/3) "); > Jwhile( x != 4); Y/bookingMenu() void popOX intc; if (count == 0)// check whether booking is empty { printf("NO BOOKING TO DELETE"); } else printf(" \tARE YOU SURE TO CANCEL THE BOOKING? \t1. YES \t2.NO"); printf(" \tYour choice: "); scanf("%d",&c); if(c == 1) rear = rear-1; printf(" - - THE BOOKING HAS BEEN DELETED ------------- "); return; 1 printf(" ------ THE BOOKING HAS NOT BEEN DELETED, THANK YOU ------ "); 1/pop() void updateProfile() int c;char update[20], [20]; printf(" - PROFIL printf(" Nickname : %s",cus. Name); printf(" IC: %s",cus.IC); printf(" Phone : %s",cus.Phone); printf(" \tWHICH PART YOU WANT TO UPDATE \t1. Name \t2.1C \t3.PHONE NUMBER"); dol printf(" \tYour choice : "); scanf("%d",&c); }while( c == 1 && c == 2 && c == 3); if (c == 1)(strcpy(update,"NICKNAME");} else if (c == 2)(strcpy(update,"IC");} else if(c == 3)(strcpy(update, "PHONE NUMBER");} printf(" NEW %s : "update); scanf("%s",&u); switch(c) case 1: strcpy(cus. Name,u);break; case 2: strcpy(cus.IC,u);break; case 3: strcpy(cus.Phone,u);break; 1 printf(" ----------- PROFIL UPDATED ! ------------ "); W/updateProfill) void report cus.totalPrice = 0; if (count == 0) // check whether booking is empty printf("NO BOOKING"); else { printf(" * printf(" **** THANK YOU FOR CHOOSING CAR RENTAL FourFlat.co **** "); printf(" Nickname: %s",cus.Name); printf(" IC:%s",cus.IC); printf(" Phone : %s",cus.Phone); for(int k=0; k #include #include #define SIZE 11 //only have 50 car int n = 0; int front = 0; int rear -1; int count = 0; void searchCar(char*,char*); void pop(); void updateProfile(); struct Cart char Place[100]; char Type(100); char Seat[10]; char Brand[100]; char Tranmission (100); char RentalType(100); float Price; }; struct Car searchListcar(100); struct Booking char date[10]; char time[10); struct Car car, }[3]; struct Customer char Name(100); char IC(20); char Phone(20); char Email(100); float totalPrice; }cus; struct Car cd[SIZE] = { ("Rompin","Proton","4","Iriz","Auto","full",50), ("Pekan","Perodua","6","Alza", "Auto","half",75), }; void displayCatalogue(struct Car cd(11), ints) inti: printf(" Place\tCar Type\tSeat\tBrand\tTransmission\tHour\tPrice "); for (i = 0; i n-1); choice = choice - 1; b(rear).car = searchListcar(choice); count++; /bookingInfo) void searchCar(char *key, char *place) int i; n=0; - SIZE - 1; printf(" \t** LIST OF AVAILABLE CAR **"); printf(" NUMBER\tPLACE\tCAR TYPE\tSEAT\tBRAND\tTRANMISSION\tHOUR\tPRICE "); whileli >= 0) if(strcmp(cd[i].Seat,key) == 0) if(strcmp(cd[i].Place,place) == 0){ searchListcar(n) = cd to: printf" %d\t%s\t%s\t\t%s\t%s\t%s\t\t%s\t%f ", n+1,cd[i].Place, cd[i].Type, cd[i].Seat.cd[i]. Brand, cd[i]. Tranmission,cd[i]. RentalType.cd[i].Price); } 1 //reduce the size of array for searching } 1/searchSeat() void cusinfo printf(" - REGISTER printf(" NICKNAME: "); scanf("%s",&cus. Name); printf(" IC: "); scanf("%s",&cus.IC); printf(" PHONE NUMBER: "); scanf("%s",&cus.Phone); printf(" EMAIL :"); scanf("%s",&cus. Email); printf(" -YOUR BOOKING IS SUCCESSFULL..."); ://customer Info() void booking Menu intx dol printf(" \t1 . ADD BOOKING \t2.CANCEL BOOKING \t3.UPDATE PROFILE \t4.EXIT \tYour choice: "); scanf("%d",&x); switch(x) case 1: Iffcount == 3){printf(" LIMIT TO 3 BOOKING ONLY ");break;) bookinginfo(); printf(" - ......YOUR BOOKING IS SUCCESSFULL"); break; case 2: pop();break; case 3: updateProfile();break; case 4: break; default: printf(" \t Please enter a Valid Choice (1/2/3) "); > Jwhile( x != 4); Y/bookingMenu() void popOX intc; if (count == 0)// check whether booking is empty { printf("NO BOOKING TO DELETE"); } else printf(" \tARE YOU SURE TO CANCEL THE BOOKING? \t1. YES \t2.NO"); printf(" \tYour choice: "); scanf("%d",&c); if(c == 1) rear = rear-1; printf(" - - THE BOOKING HAS BEEN DELETED ------------- "); return; 1 printf(" ------ THE BOOKING HAS NOT BEEN DELETED, THANK YOU ------ "); 1/pop() void updateProfile() int c;char update[20], [20]; printf(" - PROFIL printf(" Nickname : %s",cus. Name); printf(" IC: %s",cus.IC); printf(" Phone : %s",cus.Phone); printf(" \tWHICH PART YOU WANT TO UPDATE \t1. Name \t2.1C \t3.PHONE NUMBER"); dol printf(" \tYour choice : "); scanf("%d",&c); }while( c == 1 && c == 2 && c == 3); if (c == 1)(strcpy(update,"NICKNAME");} else if (c == 2)(strcpy(update,"IC");} else if(c == 3)(strcpy(update, "PHONE NUMBER");} printf(" NEW %s : "update); scanf("%s",&u); switch(c) case 1: strcpy(cus. Name,u);break; case 2: strcpy(cus.IC,u);break; case 3: strcpy(cus.Phone,u);break; 1 printf(" ----------- PROFIL UPDATED ! ------------ "); W/updateProfill) void report cus.totalPrice = 0; if (count == 0) // check whether booking is empty printf("NO BOOKING"); else { printf(" * printf(" **** THANK YOU FOR CHOOSING CAR RENTAL FourFlat.co **** "); printf(" Nickname: %s",cus.Name); printf(" IC:%s",cus.IC); printf(" Phone : %s",cus.Phone); for(int k=0; k