Question: 2. Unlike the USA postal zip codes, Canada's postal codes are alphanumeric. The Canadian postal code uses a six-character string and are in the format


2. Unlike the USA postal zip codes, Canada's postal codes are alphanumeric. The Canadian postal code uses a six-character string and are in the format A1A 1A1, where A is a letter and 1 is a digit, with a space separating the third and fourth characters. Write a program that reads a list of Canadian Postal Codes from the file "PostalCodes.txt", and then verifies whether the postal code is valid or not. Your program should use manipulators from siomanip to output the results to the console in a table format as shown in the sample output. Hints a. You can use the length) function of the string class to get the length of a string b. Even if you are using a string type variable, you can still use a subscript to access an individual character in that string because the variable is actually stored internally as a character array c. You can use the isalpha(char) function to determine whether a character is an alphabet. d. You can use the isdigit(char) function to determine whether a character is a number e. Remember to include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
