Abbreviating airport names.
When boarding passes are created for passengers, the departure and arrival airport names are written in an abbreviated form to ensure they fit within the designated area on the ticket.
Write a program that allows the user to enter the names of two airports. The program should output the first four characters of each airport separated with a hypen symbol: "-".
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.
As this is a function within a bigger system, the airport names are not input by the user. For testing purposes they are hard-coded into the function call instead. There is nothing for you to do here.
If the departure airport is London and the destination is Madrid, the output would be: LOND-MADR
If the departure airport is Palma and the destination is Manchester, the output would be: PALM-MANC
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
Dallas to Heathrow
DALL-HEAT
Heathrow to Hartsfield
HEAT-HART
John F Kennedy to Gatwick
JOHN-GATW
Check that you have: