Write a program to validate Canadian Postal Codes. A postal code must follow the pattern of L9L9L9 where:
Your program should continue accepting postal codes until the user enters the word “exit”.
Sample run (user input is shown in bold underline):
Enter a postal code: T2T-3X7
Postal code wrong length, format L9L9L9
Enter a postal code: T2T3AA
Postal code has letters where there are supposed to be digits
Enter a postal code: T2T358
Postal code has digits where there are supposed to be letters
Enter a postal code: T2T3A8
Postal code is valid!
Enter a postal code: exit
please answer in java
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here