Question: 2. (50 points) Command-line arguments, modify project 2, problem 2 (translating phone number) so the phone number is a command line argument. Example input/output: ./a.out

 2. (50 points) Command-line arguments, modify project 2, problem 2 (translating

2. (50 points) Command-line arguments, modify project 2, problem 2 (translating phone number) so the phone number is a command line argument. Example input/output: ./a.out 727-PET-CARE Output: 727-738-2273 ./a.out Output: Incorrect number of arguments. Usage: ./a.out phoneNumber ./a.out 727-PET-CARE 813-CAR-WASH Output: Incorrect number of arguments. Usage: ./a.out phoneNumber 1) Name your program command_phone.c. 2) The program should include the following function: void translate (char *word, char *phone_number); The function expects word to point to a string containing the phone number to be translated; phone_number represents the pointer pointing to the string storing the translated phone number. For example, if the word is 813-TAKE-OUT, the function will store 813-825- 3688 pointed by phone_number. 3) The program should check if the correct number of arguments are entered on the command line. If an incorrect number of arguments are entered, the program should display an message. 4) Main function displays the output

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!