Question: Question 5 2 0 pts Write a segment of code that implements a functions called doSomething ( ) that takes in a list of words
Question
pts
Write a segment of code that implements a functions called doSomething that takes in a list of words ist a string and the number of words n in list as arguments, and implements the logic described below.
dosomething searches for str in list and returns A NEW LIST containing all the words in list spelled backwards with the exception of the found string. If is not found in list, then the NEW LIST is the same as list.
For instance, if list contains ABC "DEF", "GHI", JKL and str is "DEF", then the function returns a new list containing CBA "DEF", "IHG", LKJ and if str is not found in list, then the function returns a new list containing ABC "DEF", "GHI", JKLsame as the original list
Note:
You MUST NOT modify the contents of list, nor can you use strcmp or strcpy However, you CAN use strlen
You MUST NOT use any array notation, ie
You MAY NOT assume each word in ist is the same length.
You may assume at most a SINGLE OCCURENCE of st in list:
You may assume the call to the dosomething function is made elsewhere in the code. More precisely, provide the code segment that will go in the place indicated below.
chart dosomething char list, char str int
Your code segment below goes here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
