Write a program to validate Canadian Postal Codes. A postal code must follow the pattern of L9L9L9 where: L is a letter 9 is a digit Your program should continue accepting postal codes until the user...


Write a program to validate Canadian Postal Codes. A postal code must follow the pattern of L9L9L9 where:



  • L is a letter

  • 9 is a digit


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




May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here