Question: 2. a. Write a function that takes a phone number as input and returns a string of the form: (areacode) officecode-linenumber (e.g., if input areacode
2. a. Write a function that takes a phone number as input and returns a string of the form: (areacode) officecode-linenumber (e.g., if input areacode is 518, office code is 454 and linenumber is 2105 then output should be: (518) 454-2105) b. Test your function by printing out all the rows of the directory table with phone numbers formatted nicely using your function. 2. a. Write a function that takes a phone number as input and returns a string of the form: (areacode) officecode-linenumber (e.g., if input areacode is 518, office code is 454 and linenumber is 2105 then output should be: (518) 454-2105) b. Test your function by printing out all the rows of the directory table with phone numbers formatted nicely using your function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
