Let's finish working on our booking system. The last part for our booking system will be to manage multiple flights. To do this, we'll modify our program's command list. The command "create [id] [cap]" will try to create a new empty flight with ID [id] and capacity [cap]. The command "delete [id]" will try to remove the flight with ID [id]. The command "add [id] [n]" will try to add n reservations to the flight with ID [id]. The command "cancel [id] [n]" will try to cancel n reservations from the flight with ID [id]. If an operation fails for any reason, the program will issue the message "Cannot perform this operation". You can add a more helpful message to identify why the operation failed. The command "quit" will stop the execution of the program. For the sake of simplicty, let's limit the maximum number of handled flights to ten. Use the code from your previous exercise as a starting point. Note that we need to add an access method to the flight id field.
Let's finish working on our booking system.
The last part for our booking system will be to manage multiple flights.
To do this, we'll modify our
The command "create [id] [cap]" will try to create a new empty flight with ID [id] and capacity [cap].
The command "delete [id]" will try to remove the flight with ID [id].
The command "add [id] [n]" will try to add n reservations to the flight with ID [id].
The command "cancel [id] [n]" will try to cancel n reservations from the flight with ID [id].
If an operation fails for any reason, the program will issue the message "Cannot perform this operation". You can add a more helpful message to identify why the operation failed.
The command "quit" will stop the execution of the program.
For the sake of simplicty, let's limit the maximum number of handled flights to ten.
Use the code from your previous exercise as a starting point.
Note that we need to add an access method to the flight id field.
PLS ANSWER THIS CODE IN C++
Step by step
Solved in 3 steps with 1 images