You are writing a computer program for an airline company. The program will be used at a check-in desk to generate and print custom boarding passes.
The program captures several user inputs before generating the pass.
In order to make your program more robust, you decide to implement validation routines so that any invalid input is detected and automatically rejected by the program.
Your task is to complete the code below to implement the following validation checks:
- The firstname and lastname of the passenger cannot be left blank,
- The airport codes (departure and arrival) have to be exactly 3 characters long,
- The airport codes (departure and arrival) should be automatically converted to UPPERCASE,
- The program should ask whether or not a QR code will be printed on the boarding pass. Only a “Yes” or a “No” answer should be accepted,
- The gate number has to be based on the following format: 1 uppercase letter + 2-digit number,
- The flight number has to be based on the following format: 2 uppercase letters + 4-digit number,
- The departure and arrival times must be in the 12:60 AM/PM format,
- The date must be in the DD/MM/YYYY format.