Question
1) Name your program word_numbers.c. Your program should include the following function: void convert(char *word, char *numbers); 2) Assume input is no longer than 1000
1) Name your program word_numbers.c. Your program should include the following function: void convert(char *word, char *numbers);
2) Assume input is no longer than 1000 characters.
3) The convert function should use pointer arithmetic (instead of array subscripting). In other words, eliminate the loop index variables and all use of the [] operator in the function. 4) To read a line of text, use the read_line function (the pointer version) in the lecture notes.
Write a program that modifies a word by replacing every alphabetical letter (lower case or upper case) with a digit (2-9). The numbers 2 through 9 each have three letters associated with them, as is indicated by the following table:
Digit Letter
2 A B C
3 D E F
4 G H I
5 J K L
6 M N O
7 P Q R S
8 T U V
9 W X Y Z
The function expects word to point to a string containing to be translated; numbers represents the pointer pointing to the string storing the numbers. For example, if the word is TAKEOUT, the function will store 8253688 pointed by numbers.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started