Complete the following 2 questions in C++: 1. Ask the user for some text. Verify the input is exactly 14 characters. View required output Test Case 1 Standard Input XXXXXXXXXXEnter exactly 14...

Complete the following 2 questions in C++: 1. Ask the user for some text. Verify the input is exactly 14 characters. View required output Test Case 1 Standard Input (805) 922-6966 Enter exactly 14 characters\n (805) 922-6966 -> Accepted\n Test Case 2 Standard Input 8059226966 Enter exactly 14 characters\n 8059226966 -> Input must be exactly 14 characters: (XXX) XXX-XXXX\n Test Case 3 Standard Input abcdefghijklm Enter exactly 14 characters\n abcdefghijklm -> Input must be exactly 14 characters: (XXX) XXX-XXXX\n Test Case 4 Standard Input abcdefghijklmn Enter exactly 14 characters\n abcdefghijklmn -> Accepted\n Test Case 5 Standard Input abcdefghijklmno Enter exactly 14 characters\n abcdefghijklmno -> Input must be exactly 14 characters: (XXX) XXX-XXXX\n Test Case 6 Standard Input gggg Enter exactly 14 characters\n gggg -> Input must be exactly 14 characters: (XXX) XXX-XXXX\n Test Case 7 Standard Input q w e r t y u i o p Enter exactly 14 characters\n q w e r t y u i o p -> Input must be exactly 14 characters: (XXX) XXX-XXXX\n 2. Ask the user for a phone number. Verify the phone number is: Exactly 14 characters long Has both an open and closing parenthesis Has a space Has a dash View required output Test Case 1 Standard Input abc Enter a phone number in the following format: (XXX) XXX-XXXX\n abc -> Input must be exactly 14 characters\n Test Case 2 Standard Input qqqqqqqqqqqqq Enter a phone number in the following format: (XXX) XXX-XXXX\n qqqqqqqqqqqqq -> Input must be exactly 14 characters\n Test Case 3 Standard Input qqqqqqqqqqqqqx Enter a phone number in the following format: (XXX) XXX-XXXX\n qqqqqqqqqqqqqx -> Missing character: (\n Test Case 4 Standard Input (123fdertgbvcx Enter a phone number in the following format: (XXX) XXX-XXXX\n (123fdertgbvcx -> Missing character: )\n Test Case 5 Standard Input (123)fdertgbvc Enter a phone number in the following format: (XXX) XXX-XXXX\n (123)fdertgbvc -> Missing a space\n Test Case 6 Standard Input (123)fdrtg bvc Enter a phone number in the following format: (XXX) XXX-XXXX\n (123)fdrtg bvc -> Missing character: -\n Test Case 7 Standard Input (805) 922-6966 Enter a phone number in the following format: (XXX) XXX-XXXX\n (805) 922-6966 -> Accepted\n Test Case 8 Standard Input (805)922-6966 Enter a phone number in the following format: (XXX) XXX-XXXX\n (805)922-6966 -> Input must be exactly 14 characters\n Test Case 9 Standard Input (805)9122-6966 Enter a phone number in the following format: (XXX) XXX-XXXX\n (805)9122-6966 -> Missing a space\n Test Case 10 Standard Input really long input this is a test Enter a phone number in the following format: (XXX) XXX-XXXX\n really long input this is a test -> Input must be exactly 14 characters\n Test Case 11 To prevent hardcoding, this test case is hidden. To pass this case, be sure that all the programming requirements are met. Test Case 12 Standard Input x805) 922-6966 Enter a phone number in the following format: (XXX) XXX-XXXX\n x805) 922-6966 -> Missing character: (\n Test Case 13 Standard Input (805x 922-6966 Enter a phone number in the following format: (XXX) XXX-XXXX\n (805x 922-6966 -> Missing character: )\n Test Case 14 Standard Input (805)x922-6966 Enter a phone number in the following format: (XXX) XXX-XXXX\n (805)x922-6966 -> Missing a space\n Test Case 15 Standard Input (805) 922x6966 Enter a phone number in the following format: (XXX) XXX-XXXX\n (805) 922x6966 -> Missing character: -\n
May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here