Home > Back-end >  Are driven C of the novice to ask bosses for big job
Are driven C of the novice to ask bosses for big job

Time:09-17

Is catch a c + + project, subject as follows, there has been a confused, the following flights and passengers are used the two list, I want to create these two classes, the class contains flight information, passenger information, so how to use the list? Because I read on the Internet before the subject basic structure is add list, but I want to use the class list, bosses, how to implement it, please urgent, hope your bosses can provide some train of thought,

1. The dynamic data structure (dynamic array, list, etc.), and file operations: (1) (flight ticket system) please programming to realize a flight ticket system, asked to complete the following functions:
? The civil aviation flight number is not fixed, required to provide increased flights and cancel the function of a certain flight,
? Can query flight information, the program can be based on user interactive input into station name, query the flight number, ticket
Conditions such as flight information;
? Passenger information browsing, according to the flight number, list the flight tickets have passenger lists,
? Tickets booking function: according to the flight number for the customer, such as more than the flight tickets, tickets for the customer; As the flight
Already full, display the corresponding information,
? Refund: can according to the requirements of passengers booked ticket exit has
? Tip: you can consider using chain table, table creation route for each flight should include the following information: flight number, arrived in
Port, with a total seating, ticket, passenger lists, etc.; The passenger list is another singly linked list, each passenger
Information: the passenger name, id number, seat number, etc., for the convenience of search, can consider to sort by the passenger's name,

CodePudding user response:

Dynamic array can be used, since this is a c + +, you can directly use c + + standard library containers, such as vector map, etc

CodePudding user response:

C + + in the structure of the body it can be seen as no class member functions, such as linked lists and structure as a linked list method is completely consistent,
So how to structure using online list, you can use what the class list,
Example:
Struct a {
Struct a * nextp;
};
, the top and bottom are both singly linked list,
Class a {
Class a * nextp;
};
  • Related