Discount Fly is an airline which needs you to create a program to store a customer's name, address, city, province and postal code to a text file. When the program first executes, it should display any information which is already saved into the file. After the contents of the file are displayed, ask the user how many customers to add. Use a loop, input all of the customer information and write the data to the file. Use the append method so you don't lose any information currently in the file.
For full marks, you will need to provide error guards in any input which can cause errors. You will also need to validate the postal code to ensure it is in a valid Canadian postal code format. The format is L#L #L#, where L is a letter and # is an integer. You will need to extract each character one at a time and determine if it is a letter or number.
Comments
Leave a comment