Question: Write a program that prompts the user to enter a telephone number in the format ddd-ddd-dddd, where d is a digit [0-9]. This is the
Write a program that prompts the user to enter a telephone number in the format ddd-ddd-dddd, where d is a digit [0-9]. This is the format for telephone numbers in North America.
Test that the input is in the correct format and further check if the phone number has a Canadian area code (see the list of Canadian area codes ). The program will report if the input is valid or not. If the input includes a Canadian area code, the program will display the name of the province or territory with that area code. The program will continue to process numbers until the user enters the letter q.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
