Create a program that will ask the user for two strings, StringA and then String
ID: 3610479 • Letter: C
Question
Create a program that will ask the user for two strings, StringA and then String B. The program will then create andprintout a new string (Output string) which has the elements ofString B now embedded into String A, in a way so that the elementsalternate: first element from A, first element from B, nextelement from A, next element from B and so on.
The program should ask the user for String A and String B in themain program and then call a function with the strings asarguments, The main program should also pass the Output string tothe function as well. The function will fill-in the elementsof the Output string and then the main program should print theOutput string on the console.
If either String A or B is longer than the other, then the extraelements are to be placed consecutively at the end of Outputstring.
Here is an example:
String A: ABCDE
String B: 12345678
Output string: A1B2C3D4E5678
The three test cases to run andhand-in are:
Case 1: String A: ABCD
String B: 1234
Case 2: StringA: MATLAB
String B: C++
Case 3: StringA: TE
String B: H-END
Explanation / Answer
please rate - thanks #include #include using namespace std; void merge(string,string,string&); void insert(string,int&, string&,int&); int main() {string A,B,C; coutA; while(A!="done") {coutB; C=""; merge(A,B,C); coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.