(Solved) : Write Program Validate Phone Number Input User North America Number Expected String 10 Dig Q35590704
Write a program to validate a phone number input bythe user. In North America
the number is expected to be a string of 10 digits, while theycould in these
formats: 2047773333, (204)777-3333, or 204-777-333. Your programshould
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 toinput the phone
number until the user types in “exit”.
This should be a java program