Expand|Select|Wrap|Line Numbers
- int main()
- {
- chooseflight();
- fflush(stdin);
- return 0;
- }
- void chooseflight(void)
- {
- char selectflight;
- printf("a) Flight 102 b) Flight 311 c) Flight 444 d) Flight 519 e)Quitprogram\n");
- scanf("%c",&selectflight);
- switch(selectflight)
- {
- case 'a':
- puts("Welcome to flight 102 service");
- while(1){
- printmenu102();
- }
- break;
- case 'b':
- puts("Welcome to flight 311 service");
- while(1){
- printmenu311();
- break;
- }
- case 'c':
- puts("Welcome to flight 444 service");
- while(1){
- printmenu444();
- }
- break;
- case 'd':
- puts("Welcome to flight 519 service");
- while(1){
- printmenu519();
- }
- break;
- case 'e':
- Quitprogram();
- break;
- }
- }
- void printmenu102()
- {
- char lablename;
- printf("a) Show number of empty seats b) Show list of empty seats c)Show alphabetical list of seats d) Assign a passenger toa seat e)Delete a seat assignment f) Quittotopmenu\n");
- scanf("%c",&lablename);
- switch(lablename)
- {
- case 'a':
- Noofemptyseats102();
- break;
- case 'b':
- Listofemptyseats102();
- break;
- case 'c':
- Alphabeticallistofseats102();
- break;
- case 'd':
- Assingseats102();
- break;
- case 'e':
- Deleteseats102();
- break;
- case 'f':
- Quittotopmenu();
- break;
- }
- }
- void Quitprogram(void)
- {
- exit(EXIT_FAILURE);
- }
- void Quittotopmenu(void)
- {
- chooseflight();
- }
a) Flight 102 b) Flight 311 c) Flight 444 d) Flight 519 e)Quitprogram
a
Welcome to flight 102 service
a) Show number of empty seats b) Show list of empty seats c)Show alphabetical list of seats d) Assign a passenger toa seat e)Delete a seat assignment f) Quittotopmenu
a) Show number of empty seats b) Show list of empty seats c)Show alphabetical list of seats d) Assign a passenger toa seat e)Delete a seat assignment f) Quittotopmenu
f
a) Flight 102 b) Flight 311 c) Flight 444 d) Flight 519 e)Quitprogram
a) Show number of empty seats b) Show list of empty seats c)Show alphabetical list of seats d) Assign a passenger toa seat e)Delete a seat assignment f) Quittotopmenu