The C language implements the airplane booking system

  • 2020-06-23 01:22:25
  • OfStack

Problem description and title requirements

Problem description: Suppose a civil aviation has an M flight, each flight only arrives at 1 place. Try to design an automatic ticket booking and refund system for the airport ticket office with the following functions:
(1) Booking: If the number of remaining tickets for the flight is greater than or equal to the number of passengers booking, the information item of passengers booking the flight is inserted in the passenger table of the flight, and relevant data of the flight is modified; otherwise, corresponding information is provided.
(2) Refund: If the number of refunded tickets is less than or equal to the number of original tickets, the item of the passenger is found in the corresponding passenger table, and the relevant data of the flight and the passenger table are modified; When a passenger cancels the number of reservations due to a refund to zero, the data item is revoked from the passenger table.

Requirements:

(1) Describe the data structure selected for the voyage schedule and passenger schedule.
(2) Programming the air ticket booking and refund system.

Model assumes

1. Assume that all inputs are integers and within the representation range of type int
2. Assume that the voyage is a continuous integer from 1 to n
3. Assume that each passenger ID has only 1

The selection of data structures

A similar data structure is used to describe the problem by referring to the adjacency list in the figure
Flight schedule: 1 array, flight_info_list, is used to store the passenger schedule of each flight. The index of this array is the flight schedule, and the corresponding element is the relevant information of the flight (passenger schedule, flight number and remaining tickets).
Passenger table: Two-way linked list is used to store the passenger table passenger_info_list for each voyage, and each node stores the passenger's ID, the number of tickets and the pointer to the front and back nodes

Programming implementation (C language implementation)


/*
 * @Description:  A simulated flight booking system 
 *  Model assumes :
 *   1.  The maximum carrying capacity of the aircraft is 300 people 
 *   2.  A total of 10 A voyage 
 *  Two-way linked lists are used to store passenger information 
 *  with array Store flight information 
 * @Author: Fishermanykx
 * @Date: 2019-09-29 10:32:56
 * @LastEditors: Fishermanykx
 * @LastEditTime: 2019-09-30 12:29:16
 */

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define MAX_CAPACITY 300 //  It is assumed that the maximum carrying capacity of the aircraft is 300
#define TOTAL_AIRLINE 10 //  Suppose the maximum number of different routes is 10
#define BOOK_TICKET 1
#define REFUND -1
#define EXIT_SYSTEM 0
#define PRINT_INFO 11
#define ROOT 123456

//  A certain flight 
struct SingleFlight {
 int flight_id;    //  Flight number, from 1 Began to, TOTAL_AIRLINE So far, 
 int remain_tickets; //  Tickets are available for this flight 
 struct SinglePassenger* passenger_info_list; //  Passenger list for this flight 
};

//  Information about a passenger on a particular flight 
struct PassengerInfo {
 int passenger_id;  //  passengers id
 int ticket_number; //  The passenger bought tickets 
};

//  Passenger manifest 1 A node 
struct SinglePassenger {
 struct PassengerInfo passenger_info;   //  Passenger information 
 struct SinglePassenger* prev_passenger; //  Point to the former 1 A passenger's pointer 
 struct SinglePassenger* next_passenger; //  After pointing to 1 A passenger's pointer 
};

typedef struct SingleFlight SingleFlight;
typedef struct SinglePassenger SinglePassenger;

//  Booking operation 
SingleFlight* BookTicket(SingleFlight flight_info_list[]);
SinglePassenger* GetNewPassenger(const int new_passenger_id,
                 const int book_ticket_number);
SinglePassenger* AddNewPassenger(SinglePassenger* head,
                 const int new_passenger_id,
                 const int book_ticket_number);

//  Refund operation 
SingleFlight* Refund(SingleFlight flight_info_list[]);
SinglePassenger* RemovePassenger(SinglePassenger* head, const int passenger_id);
//  Judge operation 
bool IsPassengerExist(SinglePassenger* head, const int passenger_id);
//  Print operation 
void PrintCurrentAirlineInfo(SingleFlight flight_info_list[]);
void PrintPassengerList(SinglePassenger* head, SingleFlight* flight_info_list,
            int airline_id);

int main(void) {
 int order, exit_loop = 1;

 //  Initialize flight information 
 SingleFlight* flight_info_list;
 flight_info_list =
   (SingleFlight*)malloc(TOTAL_AIRLINE * sizeof(SingleFlight));
 for (int i = 0; i < TOTAL_AIRLINE; ++i) {
  flight_info_list[i].flight_id = i + 1;
  flight_info_list[i].remain_tickets = MAX_CAPACITY;
  flight_info_list[i].passenger_info_list = NULL;
 }

 /*  Login screen  */
 printf(" Hello, welcome to use this system! \n\n");
 printf(" Instructions for use: \n");
 printf("1.  All inputs to this procedure are integers \n");
 printf("2.  The optional voyage number is 1-%d,  Maximum passenger capacity per sortie is %d\n", TOTAL_AIRLINE,
     MAX_CAPACITY);
 printf(
   "3.  If booking, please enter 1 ; If refund, please enter -1 ; To exit the system, please enter 0; "
   " If you want to root User login, please enter root password \n");
 printf(" This is the end of the instructions, wish you a happy use! \n");

 //  Judge whether or not root The login 
 int log_in_as_root, root_key;
 bool is_root = false;

 printf("-------------------------------------------------------------\n\n");
 printf(" Whether or not to root User login? If yes, please enter 1 , or please enter 0:");
 scanf("%d", &log_in_as_root);

 if (log_in_as_root) printf(" Please enter the root password ( According to the 0 exit root The login process ) : ");
 while (log_in_as_root) {
  scanf("%d", &root_key);
  if (!root_key) {
   break;
  } else if (root_key != ROOT) {
   printf(" Incorrect password! Please re-enter or press 0 exit root Login procedure: ");
  } else {
   is_root = true;
   break;
  }
 }
 //  The welcome screen 
 if (is_root)
  printf(" Welcome, root Users! The input 11 Current voyage schedule can be viewed \n");
 else
  printf(" Welcome, ordinary users! \n");
 printf("-------------------------------------------------------------\n");

 //  The main loop 
 while (true) {
  if (is_root)
   printf(" Please enter the 1, 0, -1 or 11 In the 1 A digital : ");
  else
   printf(" Please enter the 1, 0, -1 In the 1 A digital : ");

  scanf("%d", &order);
  switch (order) {
   case BOOK_TICKET:
    flight_info_list = BookTicket(flight_info_list);
    break;
   case REFUND:
    flight_info_list = Refund(flight_info_list);
    break;
   case EXIT_SYSTEM:
    exit_loop = 0;
    break;
   case PRINT_INFO:
    printf(
      "-------------------------------------------------------------\n");
    PrintCurrentAirlineInfo(flight_info_list);
    break;
   default:
    printf(" Illegal input! \n");
    break;
  }
  if (!exit_loop) break;
 }

 return 0;
}

/**
 * @description: 1 Simulation of secondary booking operation 
 * @param {type}
 * flight_info_list {SingleFlight *}:  Flight information sheet ( Voyage table )
 * @return:
 */
SingleFlight* BookTicket(SingleFlight flight_info_list[]) {
 /*  Obtain passenger reservations  */
 int target_airline;
 printf(" The number corresponding to the optional voyage is : 1 - %d\n", TOTAL_AIRLINE);
 printf(" Please enter the voyage you want to book ( The input 0 Exit the booking procedure ): ");
 //  Judge the validity of input 
 while (true) {
  scanf("%d", &target_airline);
  if (target_airline < 0 || target_airline > TOTAL_AIRLINE) {
   printf(" The voyage you are booking does not exist! \n");
   printf(" Please re-enter 1 For the correct voyage, or press 0 Exit booking procedure: ");
  } else if (target_airline == 0) {
   printf("-------------------------------------------------------------\n");
   return flight_info_list;
  } else
   break;
 }

 /*  For passengers id */
 int passenger_id;
 int modify_tickets;
 printf(" If you have already booked and want to increase the number of your bookings, please enter 1 , or please enter 0: ");
 //  Judge the validity of input 
 while (true) {
  scanf("%d", &modify_tickets);
  if (modify_tickets != 1 && modify_tickets != 0) {
   printf(" The command you entered is illegal. Please reenter it 0( Not originally booked ) or 1( Had been booked previously ) : ");
  } else
   break;
 }
 printf(" Please enter yours ID: ");
 //  If not booked previously 
 while (!modify_tickets) {
  scanf("%d", &passenger_id);
  if (IsPassengerExist(
      flight_info_list[target_airline - 1].passenger_info_list,
      passenger_id)) {
   printf(" the ID Exists, please enter 1 A new one ID: ");
  } else
   break;
 }
 //  If you have booked your ticket 
 if (modify_tickets) {
  scanf("%d", &passenger_id);
  if (!IsPassengerExist(
      flight_info_list[target_airline - 1].passenger_info_list,
      passenger_id)) {
   printf(" You did not book the flight! \n");
   printf("-------------------------------------------------------------\n");
   return flight_info_list;
  }
 }

 /*  Obtain passenger reservations  */
 //  Obtain the remaining votes for the current voyage 
 int remain_tickets;

 remain_tickets = flight_info_list[target_airline - 1].remain_tickets;
 printf(" The remaining number of tickets for the current voyage is : %d\n", remain_tickets);
 //  If the passenger wants to change the ticket number, it shows the ticket number that the passenger booked earlier 
 if (modify_tickets) {
  SinglePassenger* head =
    flight_info_list[target_airline - 1].passenger_info_list;
  while (head->passenger_info.passenger_id != passenger_id) {
   head = head->next_passenger;
  }
  printf(" The number of tickets you have booked is %d zhang \n", head->passenger_info.ticket_number);
 }
 //  Get the number of tickets the passenger wants to book 
 int target_ticket_num;

 printf(" Please enter your wish to book ( Or additional ) The number of votes : ");
 //  Judge the validity of input 
 while (true) {
  scanf("%d", &target_ticket_num);
  if (target_ticket_num > remain_tickets) {
   printf(" The number of tickets you want to reserve is %d,  But the remaining number of tickets for the current voyage is only %d,  Not enough tickets left! \n",
       target_ticket_num, remain_tickets);
   printf(" Please enter the number of tickets you want to reserve, or press 0 Exit booking procedure : ");
  } else if (target_ticket_num == 0) {
   printf("-------------------------------------------------------------\n");
   return flight_info_list;
  } else {
   break;
  }
 }

 /*  Amend the number of tickets remaining on the voyage  */
 flight_info_list[target_airline - 1].remain_tickets -= target_ticket_num;

 /*  Modify the corresponding item in the passenger table  */
 //  Determine if the passenger originally existed 
 if (modify_tickets) {
  //  If so, locate the passenger and modify his reservation 
  SinglePassenger* tmp =
    flight_info_list[target_airline - 1].passenger_info_list;
  while (tmp->passenger_info.passenger_id != passenger_id) {
   tmp = tmp->next_passenger;
  }
  tmp->passenger_info.ticket_number += target_ticket_num;
  printf(" Add successfully! You are available now %d Aerial time %d Tickets for the \n",
      tmp->passenger_info.ticket_number, target_airline);

 } else {
  //  If it does not exist, the passenger and the corresponding information are added to the passenger list for that flight 
  flight_info_list[target_airline - 1].passenger_info_list = AddNewPassenger(
    flight_info_list[target_airline - 1].passenger_info_list, passenger_id,
    target_ticket_num);
  printf(" Successful reservation! You are available now %d Aerial time %d Tickets for the \n", target_ticket_num,
      target_airline);
 }
 printf("-------------------------------------------------------------\n");

 return flight_info_list;
}

/**
 * @description:  Find passenger list ( Two-way linked list ) Whether a passenger exists 
 * @param {type}
 * head {SinglePassenger*}:  Two-way linked table head 
 * passenger_id {const int}:  The key value to look up 
 * @return:  If present, return true ; Otherwise returns false
 */
bool IsPassengerExist(SinglePassenger* head, const int passenger_id) {
 SinglePassenger* tmp = head;
 bool exist = false;
 if (!head) {
  return false;
 }
 while (tmp) {
  if (tmp->passenger_info.passenger_id == passenger_id) {
   exist = true;
   break;
  }
  tmp = tmp->next_passenger;
 }

 return exist;
}

/**
 * @description:  Initialize the 1 A new node 
 * @param {type}
 * new_passenger_id {const int}:  Of the new passengers id
 * book_ticket_number {const int}:  Additional passenger bookings 
 * @return:  Initialized nodes ( The precursor and the successor are null Pointers )
 */
SinglePassenger* GetNewPassenger(const int new_passenger_id,
                 const int book_ticket_number) {
 SinglePassenger* new_passenger =
   (SinglePassenger*)malloc(sizeof(SinglePassenger));

 new_passenger->passenger_info.passenger_id = new_passenger_id;
 new_passenger->passenger_info.ticket_number = book_ticket_number;
 new_passenger->next_passenger = NULL;
 new_passenger->prev_passenger = NULL;

 return new_passenger;
}

SinglePassenger* AddNewPassenger(SinglePassenger* head,
                 const int new_passenger_id,
                 const int book_ticket_number) {
 SinglePassenger* new_passenger =
   GetNewPassenger(new_passenger_id, book_ticket_number);
 if (!head) {
  head = new_passenger;
 } else {
  //  Insert directly from the head 
  new_passenger->next_passenger = head->next_passenger;
  if (head->next_passenger) {
   head->next_passenger->prev_passenger = new_passenger;
  }
  new_passenger->prev_passenger = head;
  head->next_passenger = new_passenger;
 }

 return head;
}

/**
 * @description: 1 Simulation of the operation of the second refund 
 * @param {type}
 * flight_info_list {SingleFlight *}:  Voyage table 
 * @return:  Revised voyage schedule 
 */
SingleFlight* Refund(SingleFlight flight_info_list[]) {
 /*  Obtain passenger reservations  */
 int target_airline;

 printf(" The number corresponding to the optional voyage is : 1 - %d\n", TOTAL_AIRLINE);
 printf(" Please enter the voyage you wish to unbook ( The input 0 Exit the booking procedure ): ");
 //  Judge the validity of input 
 while (true) {
  scanf("%d", &target_airline);
  if (target_airline < 0 || target_airline > TOTAL_AIRLINE) {
   printf(" The voyage you want to cancel does not exist! \n");
   printf(" Please re-enter 1 For the correct voyage, or press 0 Exit the refund procedure: ");
  } else if (target_airline == 0) {
   printf("-------------------------------------------------------------\n");
   return flight_info_list;
  } else
   break;
 }

 /*  For passengers ID And judge its legitimacy  */
 int passenger_id;

 printf(" Please enter yours ID: ");
 scanf("%d", &passenger_id);

 SinglePassenger* head =
   flight_info_list[target_airline - 1].passenger_info_list;

 if (!IsPassengerExist(head, passenger_id)) {
  printf(" You did not book this flight! \n");
  printf("-------------------------------------------------------------\n");
  return flight_info_list;
 }

 /*  Get the number of passenger refunds  */
 //  Print this passenger's reservation number 
 SinglePassenger* tmp = head;

 while (tmp->passenger_info.passenger_id != passenger_id) {
  tmp = tmp->next_passenger;
 }
 printf(" The number of tickets you are currently booking is : %d zhang \n", tmp->passenger_info.ticket_number);
 //  Read in the number of returned tickets 
 int refund_ticket_num;

 printf(" Please enter your refund number ( The input 0 Exit the refund procedure ): ");
 scanf("%d", &refund_ticket_num);
 //  Input validity check 
 int cur_ticket = tmp->passenger_info.ticket_number; //  The number of tickets currently booked by the passenger 
 while (cur_ticket < refund_ticket_num) {
  if (!refund_ticket_num) {
   printf("-------------------------------------------------------------\n");
   return flight_info_list;
  }
  printf(" The number of refunds you entered is greater than the number of tickets you currently booked! ");
  printf(" Please re-enter the number of returned tickets ( The input 0 Exit the refund procedure ): ");
  scanf("%d", &refund_ticket_num);
 }

 /*  refund  */
 //  Update voyage schedule 
 flight_info_list[target_airline - 1].remain_tickets += refund_ticket_num;
 //  Update passenger list 
 if (cur_ticket > refund_ticket_num) {
  tmp->passenger_info.ticket_number -= refund_ticket_num;
  printf(" You have successfully returned the ticket. Now you %d The remainder of the voyage is %d zhang \n", target_airline,
      tmp->passenger_info.ticket_number);
 } else {
  flight_info_list[target_airline - 1].passenger_info_list =
    RemovePassenger(head, passenger_id);
  printf(" You have successfully returned the ticket. Now you %d The remainder of the voyage is %d zhang \n", target_airline, 0);
 }
 printf("-------------------------------------------------------------\n");

 return flight_info_list;
}

/**
 * @description:  Removes a node from the passenger table 
 * @param {type}
 * head {SinglePassenger *}:  The passenger list 
 * passenger_id {const int}:  Passengers to be deleted id
 * @return:  Revised voyage schedule 
 */
SinglePassenger* RemovePassenger(SinglePassenger* head,
                 const int passenger_id) {
 SinglePassenger* tmp = head;

 while (tmp->passenger_info.passenger_id != passenger_id) {
  tmp = tmp->next_passenger;
 }
 //  If it's a head 
 if (!tmp->prev_passenger) {
  head = head->next_passenger;
 }
 //  If is the tail node 
 else if (!tmp->next_passenger) {
  tmp->prev_passenger->next_passenger = NULL;
 }
 //  If it's some middle node 
 else {
  tmp->prev_passenger->next_passenger = tmp->next_passenger;
  tmp->next_passenger->prev_passenger = tmp->prev_passenger;
 }

 return head;
}

/**
 * @description:  Output current voyage table 
 * @param {type}
 * flight_info_list {SingleFlight *}:  Flight information sheet ( Voyage table )
 * @return: void
 */
void PrintCurrentAirlineInfo(SingleFlight flight_info_list[]) {
 for (int current_airline_index = 1; current_airline_index <= TOTAL_AIRLINE;
    ++current_airline_index) {
  int remain_ticket_num =
    flight_info_list[current_airline_index - 1].remain_tickets;
  SinglePassenger* head =
    flight_info_list[current_airline_index - 1].passenger_info_list;
  //  The output 
  PrintPassengerList(head, flight_info_list, current_airline_index);
  printf("-------------------------------------------------------------\n");
 }
}

/**
 * @description:  Print out a passenger list for a particular flight 
 * @param {type}
 * head {SinglePassenger*}:  The head of the passenger table 
 * flight_info_list {SingleFlight *}:  Voyage table 
 * @return:
 */
void PrintPassengerList(SinglePassenger* head, SingleFlight* flight_info_list,
            int airline_id) {
 if (!head) {
  printf("%d Flight booking without passengers! \n", airline_id);
 } else {
  printf("%d The number of tickets remaining on the voyage is : %d,  Among them: \n", airline_id,
      flight_info_list[airline_id - 1].remain_tickets);
 }
 while (head) {
  printf("ID for %d Number of passenger bookings is %d zhang \n", head->passenger_info.passenger_id,
      head->passenger_info.ticket_number);
  head = head->next_passenger;
 }
 printf("\n");
}

Implementation window

1. Each step of the operation has the processing of illegal input, which ensures the stability of the program operation to the maximum extent
2. Distinguish root users from ordinary users, and only root users can see the booking status of everyone, thus protecting the privacy of customers
3. The use of two-way linked list to store passenger information, to facilitate access of passengers 1 information (fixed-length distribution of array is stack memory and stack memory less than heap memory, so use list for storage are less likely to cause memory leak), the other one has reduced the difficulty of programming (don't need to implement dynamic memory allocation on the array of 1 series of operations, and minimize the complexity of node delete)

Implement drawback

1. Only numeric input is considered, not character and other data types
2. The use of linked list storage results in random access, so that the complexity of search operation is always O(n) O(n)O(n)

The results


 Hello, welcome to use this system! 

 Instructions for use: 
1.  All inputs to this procedure are integers 
2.  The optional voyage number is 1-10,  Maximum passenger capacity per sortie is 300
3.  If booking, please enter 1 ; If refund, please enter -1 ; To exit the system, please enter 0;  If you want to root User login, please enter root password 
 This is the end of the instructions, wish you a happy use! 
-------------------------------------------------------------

 Whether or not to root User login? If yes, please enter 1 , or please enter 0:1
 Please enter the root password ( According to the 0 exit root The login process ) : 123456
 Welcome, root Users! The input 11 Current voyage schedule can be viewed 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you want to book ( The input 0 Exit the booking procedure ): 1
 If you have already booked and want to increase the number of your bookings, please enter 1 , or please enter 0: 0 
 Please enter yours ID: 1
 The remaining number of tickets for the current voyage is : 300
 Please enter your wish to book ( Or additional ) The number of votes : 12
 Successful reservation! You are available now 12 Aerial time 1 Tickets for the 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you want to book ( The input 0 Exit the booking procedure ): 1
 If you have already booked and want to increase the number of your bookings, please enter 1 , or please enter 0: 0
 Please enter yours ID: 2
 The remaining number of tickets for the current voyage is : 288
 Please enter your wish to book ( Or additional ) The number of votes : 21
 Successful reservation! You are available now 21 Aerial time 1 Tickets for the 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you want to book ( The input 0 Exit the booking procedure ): 1
 If you have already booked and want to increase the number of your bookings, please enter 1 , or please enter 0: 0
 Please enter yours ID: 3
 The remaining number of tickets for the current voyage is : 267
 Please enter your wish to book ( Or additional ) The number of votes : 32
 Successful reservation! You are available now 32 Aerial time 1 Tickets for the 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you want to book ( The input 0 Exit the booking procedure ): 2
 If you have already booked and want to increase the number of your bookings, please enter 1 , or please enter 0: 0
 Please enter yours ID: 32
 The remaining number of tickets for the current voyage is : 300
 Please enter your wish to book ( Or additional ) The number of votes : 2
 Successful reservation! You are available now 2 Aerial time 2 Tickets for the 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you want to book ( The input 0 Exit the booking procedure ): 10
 If you have already booked and want to increase the number of your bookings, please enter 1 , or please enter 0: 0
 Please enter yours ID: 212
 The remaining number of tickets for the current voyage is : 300
 Please enter your wish to book ( Or additional ) The number of votes : 123
 Successful reservation! You are available now 123 Aerial time 10 Tickets for the 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you want to book ( The input 0 Exit the booking procedure ): 1
 If you have already booked and want to increase the number of your bookings, please enter 1 , or please enter 0: 1
 Please enter yours ID: 1
 The remaining number of tickets for the current voyage is : 235
 The number of tickets you have booked is 12 zhang 
 Please enter your wish to book ( Or additional ) The number of votes : -1
 Add successfully! You are available now 11 Aerial time 1 Tickets for the 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : -1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you wish to unbook ( The input 0 Exit the booking procedure ): 1
 Please enter yours ID: 2
 The number of tickets you are currently booking is : 21 zhang 
 Please enter your refund number ( The input 0 Exit the refund procedure ): 222
 The number of refunds you entered is greater than the number of tickets you currently booked! Please re-enter the number of returned tickets ( The input 0 Exit the refund procedure ): 2
 You have successfully returned the ticket. Now you 1 The remainder of the voyage is 19 zhang 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you want to book ( The input 0 Exit the booking procedure ): 10
 If you have already booked and want to increase the number of your bookings, please enter 1 , or please enter 0: 32
 The command you entered is illegal. Please reenter it 0( Not originally booked ) or 1( Had been booked previously ) : 0
 Please enter yours ID: 322
 The remaining number of tickets for the current voyage is : 177
 Please enter your wish to book ( Or additional ) The number of votes : 12
 Successful reservation! You are available now 12 Aerial time 10 Tickets for the 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : -1
 The number corresponding to the optional voyage is : 1 - 10
 Please enter the voyage you wish to unbook ( The input 0 Exit the booking procedure ): 10
 Please enter yours ID: 212
 The number of tickets you are currently booking is : 123 zhang 
 Please enter your refund number ( The input 0 Exit the refund procedure ): 123
 You have successfully returned the ticket. Now you 10 The remainder of the voyage is 0 zhang 
-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 11
-------------------------------------------------------------
1 The number of tickets remaining on the voyage is : 238,  Among them: 
ID for 1 Number of passenger bookings is 11 zhang 
ID for 3 Number of passenger bookings is 32 zhang 
ID for 2 Number of passenger bookings is 19 zhang 

-------------------------------------------------------------
2 The number of tickets remaining on the voyage is : 298,  Among them: 
ID for 32 Number of passenger bookings is 2 zhang 

-------------------------------------------------------------
3 Flight booking without passengers! 

-------------------------------------------------------------
4 Flight booking without passengers! 

-------------------------------------------------------------
5 Flight booking without passengers! 

-------------------------------------------------------------
6 Flight booking without passengers! 

-------------------------------------------------------------
7 Flight booking without passengers! 

-------------------------------------------------------------
8 Flight booking without passengers! 

-------------------------------------------------------------
9 Flight booking without passengers! 

-------------------------------------------------------------
10 The number of tickets remaining on the voyage is : 288,  Among them: 
ID for 322 Number of passenger bookings is 12 zhang 

-------------------------------------------------------------
 Please enter the 1, 0, -1 or 11 In the 1 A digital : 0

Note: Ordinary users can not view all the passenger information, can only view their own ticket information

For more information, please pay attention to the topic management System Development.


Related articles: