Consider the following scenario:

With Summer travel reservations picking up due to easing COVID-19 pandemic restrictions, jack Airlines, a
regional carrier plans to award bonuses to its 50 pilots based on the number of miles they have flown over the
past five years and the number of years the pilot has worked for the company; however, the airline will only
offer bonuses to the pilots that have traveled more than the average number of miles traveled by all pilots.

The following chart lists the bonus structure for eligible pilots:
Number of Years Flown Bonus Earned
Have not flown for at least three years No Bonus
Flown for at least three years, but fewer than five years $825.00
Flown for at least five years, but fewer than eight years $1402.00
Flown for eight or more years $2060.00

Create a modular Python script requesting information to be entered about each pilot. Note: Pilots
may not work for the airline longer than 39 years because retirement is then required. Once the user enters all
pilot information, the script must establish which pilots will earn a bonus and bonus amount earned. Print a
well-formatted, professional report including a list of each pilot’s name, the number of years they have flown,
and the bonus amount earned (if any). The report must also include the average number of miles traveled by
all pilots, the number of pilots that earned a bonus, and the total bonus amount earned across all pilots.

You may assume the user will input numbers for all numeric input. However, you must perform range
validation. For example, if you were asking for a person’s age, 1000 is not a valid age. When input is invalid,
the solution must print an error message to the user and re-prompt them to enter a new value.


Your solution must incorporate lists and functions. Pay attention to the size of your functions so that
they only perform one task/logical unit of work.
You may not use the keyword global in your code. Converting a local variable in a function to a
global variable leads to spaghetti code. The only way you should share variables between functions is
by passing or returning them.
You must not exit any repetition statements using break, continue, return, or any other similar
strategy. A repetition statement must only exit when its iteration condition is false.

no libraries can be imported