Question: Please do your own work. Do not cheat. In this assignment, you are going to reverse each occurrence of a word in a given sentence.


Please do your own work. Do not cheat. In this assignment, you are going to reverse each occurrence of a word in a given sentence. This process will be applied to a number of strings, which should be stored in a two-dimensional array First, fill a string table by calling fill_table function. This function should keep asking the user for new sentences until the user enters "end", and should store these strings in the table. Then, the program should ask for a word to be searched and reversed. After each occurrence of the word is found and reversed in all strings, the result should be printed by calling the print_table function. An example is given below: Please enter a sentence: hello from the other side Please enter a sentence: this maybe the last assignment of the semester Please enter a sentence: Athens is the capital city of Greece Please enter a sentence: a thesaurus is a book in which words with similar meaning are put together Please enter a sentence: end Please enter the word: the hello from eht pehtr side this maybe eht last assignment of ent semester Aehtns is eht capital city of Greece a ehtsaurus is a book in which words with similar meaning are put togeehte You can use only strlen and strcmp as built-in string functions. Using additional string other than given in prototypes are forbidden. All string accesses must be done using pointers. This means that you cannot use brackets (0) anywhere in the code (except when defining the strings in main function and defining two-dimensional array parameters). You can assume the user will not enter more than 10 sentences (including "end"), Functions to implement: Implementing different functions other than the provided prototypes is forbidden void fill table (char table [10] [100]) This function is responsible for taking input sentences from the user until Send once and coming these sentences in table } void print table (char table[10] (100)) { Bentonces in the Y this function epon EOC penting 11 table axcept and (7 ) int find and replace string(char sentence, char word) { This Eunction as daurrence of word in sentence and calls the reverse function with appeaprate parameters FOR them to be reversed Nate that the paintinstead of void Use this to your advantage ) void reverse(char sentence int position char word) /* This function cupons for the revolg process to Here, it is guaranteed that there is an ageurende word in "sentence a position index ) void find_and_replace_table (char table(101 (100) char word) /* This function moverse all occurrence of the word being available in the table by calling appropriate function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
