当前位置:网站首页>Automatic reservation of air tickets in C language

Automatic reservation of air tickets in C language

2022-07-06 18:16:00 _ Programming_

C Language automatic reservation of air tickets

2. Automatic reservation of air tickets ( difficulty 2)
Suppose that the civil aviation company has an automatic reservation system . In this system, there is a passenger table represented by a one-way linked list , The nodes in the following table are linked in alphabetical order by the passenger's surname . for example , Here is a passenger table for a certain time . The design program completes the following functions .

Serial number data link rlink
1 lu 6 5
2 chan 4 9
3 wang 5 7
4 bao 0 2
5 mai 1 3
6 dong 8 1
7 xi 3 0
8 deng 9 6
9 cuang 2 8

1) Create a static two-way linked list L;
2) Enter the record in the table ;
3) Output all records in the table ;
4) If any passenger wants to book a ticket, the corresponding record will be added ;
5) When a passenger wants to refund his ticket, delete the corresponding record ;
6) There are reasonable hints , Each function can set up a menu , According to the prompt , Can complete relevant functional requirements .
Tips :
Static bidirectional linked list structure definition :

typedef struct node
{ char data[maxsize];// full name ,maxsize Is the maximum length of the user name that can be reached 
int link,rlink; // Forward direction 、 Backward chain , Its value is the subscript value of the passenger array 
}unode;
unode user[max]; //max Is the maximum number of customers that can be reached 

Source download

link :https://pan.baidu.com/s/1JJs9vbZahUCB6cQvXLgAVg?pwd=1111
Extraction code :1111

原网站

版权声明
本文为[_ Programming_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061012135468.html