Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions