Question: Write c++ code for the following programs using c++ strings YOU CANNOT USE ANY break, continue or goto statement IN This QUESTIONS PLEASE DO USE

 Write c++ code for the following programs using c++ strings YOU

Write c++ code for the following programs using c++ strings

CANNOT USE ANY break, continue or goto statement IN This QUESTIONS PLEASE

YOU CANNOT USE ANY break, continue or goto statement IN This QUESTIONS PLEASE DO USE THE HELPER FILES PROVIDED BY ME FOR QUESTION NUMBER 1

Note: You cannot use Extra Arrays in this function but you can create helper functions if required.

Question 1: Implement the find and replace function similar to MS word. You have to find the first matching instance of the findstring' with the replacestring' in the 'mainstring For example: mainString: "I love computing. It is so much fun" replaceString: "Lahore" mainString changes to: "I love Lahore. It is so much fun" Another example: mainString: "I love computing. It is so much fun" findString: "fun" replaceString: "going to the library" mainString changes to: "I love Lahore. It is so much going to the library HELPER FUNCTIONS You Cannot use extra Arrays in these functions //find the length of the string int stringLength(char strn) //find if a substring is present in the nain string and return its starting index if found /Freturn-1 otherwise int findString(char mainStrl], char subStr[l) /freplace a substring which is bigger than the findStr void replacewithBiggerstring(char mainStr), char replaceStr,int index,int lengthFindStr); //replace a substring which is snaller than the findStr void replacewithSmallerstring(char mainStr), char replaceStr,int index,int lengthFindStr); /freplace with a string of same size as find string void replacewithEqualString(char nainStr[], char replaceStr[],int index) /ain find and replace function...return the index at which find and replace were made /freturn -1 if findStr not found and no replacements were nade int findReplace(char mainstr[),char findStrl,char replaceStrl) void testFindReplace) char nainstr[200] = "C++ is so great and fun. char findstr[58)- "great and" char replacestr1(58] .nice. ; char replacestr2[S]"ice and simple and"; findReplace(mainstr,findstr,replacestri); cout

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!