Python Code
Scrubbing and reformatting data is a real world problem in computer science, it is the process of taking in a human input that may be in the incorrect format and cleaning it up to put it in a standard format. How can I write a program that asks someone to enter a phone number and then returns that phone number in a standard format if possible otherwise giving an error.
Examples:
Please enter a phone number including area code: 607-8675309
(607)867-5309
Please enter a phone number including area code: 16078675309
(607)867-5309
Please enter a phone number including area code: (607) Jenny I got your number, I need to make you mine, Jenny don't change your number, 8675309
(607)867-5309
I would suggest to cleanup/validate phone number formatting using regular expressions.