Question: Write a program to validate a phone number input by the user. In North America the number is expected to be a string of 10
Write a program to validate a phone number input by the user. In North America the number is expected to be a string of 10 digits, while they could in these formats: 2047773333, (204)777-3333, or 204-777-333. Your program should output "It is valid" if the 10 digits are in these three formats. Otherwise, it should output "It is invalid". Your program should keep asking user to input the phone number until the user types in "exit". This should be a java program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
