Question: I need help completing this set of problems.the Language is C++. I have the first condition down, but question two I cannot complete: 1.Prompt the

I need help completing this set of problems.the Language is C++. I have the first condition down, but question two I cannot complete: 1.Prompt the user for a phone number that's in the following format: (AAA) BBB-CCCC AAA is the area code, BBB is the exchange, CCCC is the subscriber number; all of which must be digits and must be the length show here. If the phone number is in the correct format, display the phone number in a new format: AAA.BBB.CCCC and question 2:Prompt the user for a list of phone numbers separated by commas. Use the validation rules from the last question.

I include the first question only for the validation rules, my main issue is with question two. Please and thank you... here are the test cases.

TEST CASES: (307) 736-5739,(174) 558-3171,(572) 770-1891,(411) 496-9352,(865) 999-0212,(178) 165-8712

Enter a list of phone numbers separated by commas (307) 736-5739 -> 307.736.5739 (174) 558-3171 -> 174.558.3171 (572) 770-1891 -> 572.770.1891 (411) 496-9352 -> 411.496.9352 (865) 999-0212 -> 865.999.0212 (178) 165-8712 -> 178.165.8712

Test Case 2 Standard Input (307) 736-5739,(174) 558-x171,(572) 770-1891,(411) 496-9352,(865) 999-0212,(178) 165-8712

Enter a list of phone numbers separated by commas (307) 736-5739 -> 307.736.5739 (174) 558-x171 -> Subscriber number may only contain digits: x171 (572) 770-1891 -> 572.770.1891 (411) 496-9352 -> 411.496.9352 (865) 999-0212 -> 865.999.0212 (178) 165-8712 -> 178.165.8712

Test Case 3 Standard Input (307) 736-5739999,(174) 558-3171,(572) abc-1891,(411) 496-9352,(865) 9991-212,(178) 165-8712

Enter a list of phone numbers separated by commas (307) 736-5739999 -> Input must be exactly 14 characters (174) 558-3171 -> 174.558.3171 (572) abc-1891 -> Exchange may only contain digits: abc (411) 496-9352 -> 411.496.9352 (865) 9991-212 -> Exchange must be 3 characters long: 9991 (178) 165-8712 -> 178.165.8712

Test Case 4 Standard Input (3071) 76-5739,(174) 1558-171,(572- 770-1891,(411) 496e9352,!865) 999-0212,(178) 165-8712

Enter a list of phone numbers separated by commas (3071) 76-5739 -> Area code must be 3 characters long: 3071 (174) 1558-171 -> Exchange must be 3 characters long: 1558 (572- 770-1891 -> Missing character: ) (411) 496e9352 -> Missing character: - !865) 999-0212 -> Missing character: ( (178) 165-8712 -> 178.165.8712

Test Case 5 Standard Input (307) 736-5639,(174) 558-3171,(572) 770-1821,(411) 496-9312,(865) 929-0212,(178) 165-8712

Enter a list of phone numbers separated by commas (307) 736-5639 -> 307.736.5639 (174) 558-3171 -> 174.558.3171 (572) 770-1821 -> 572.770.1821 (411) 496-9312 -> 411.496.9312 (865) 929-0212 -> 865.929.0212 (178) 165-8712 -> 178.165.8712

Test Case 6 Standard Input (307) 736-1629,(174) 558-3171,(572) 770 1821,(411 496-9312,865) 929-0212,(178) 165-8322

Enter a list of phone numbers separated by commas (307) 736-1629 -> 307.736.1629 (174) 558-3171 -> 174.558.3171 (572) 770 1821 -> Missing character: - (411 496-9312 -> Missing character: ) 865) 929-0212 -> Input must be exactly 14 characters (178) 165-8322 -> 178.165.8322

Test Case 7 Standard Input a,b,c,d,e

Enter a list of phone numbers separated by commas a -> Input must be exactly 14 characters b -> Input must be exactly 14 characters c -> Input must be exactly 14 characters d -> Input must be exactly 14 characters e -> Input must be exactly 14 characters

Test Case 8 Standard Input (307) 736-5639,(174) 558-3171,(572)7270-1821,(411) 496-9312,(865) 92x-0212,(178) th6-8712

Enter a list of phone numbers separated by commas (307) 736-5639 -> 307.736.5639 (174) 558-3171 -> 174.558.3171 (572)7270-1821 -> Missing a space (411) 496-9312 -> 411.496.9312 (865) 92x-0212 -> Exchange may only contain digits: 92x (178) th6-8712 -> Exchange may only contain digits: th6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!