Question: c ++ SPLIT.CPP Given the following function header: vector split(string target, string delimiter); implement the function split so that it returns a vector of the

c ++ SPLIT.CPP Given the following function header: vector split(string target, stringc ++ SPLIT.CPP Given the following function header: vector split(string target, string delimiter); implement the function split so that it returns a vector of the strings in target that are separated by the string delimiter. For example: split(10,20,30, ,) should return a vector with the strings 10, 20, and 30. Similarly, split(do re mi fa so la ti do, ) should return a vector with the strings do, re, mi, fa, so, la, ti, and do. Write a program that inputs two strings and calls your function to split the first target string by the second delimiter string and prints the resulting vector all on line line with elements separated by commas. REQUIRED: You MUST use vectors to write this program. You may not use any C++ functions that we have NOT discussed in lecture. The strings printed by the program should include a newline at the end. The program should print a string of text to the terminal before getting each line of input from the user. A session should look like one of the following examples (including whitespace and formatting), with possibly different numbers in the output:

SPLIT CPP Given the following function header: vector split ng target, string del implement the function split so that it returns a vector of the strings in target that are separated by the string delimiter. For example: spl 0,20,30 should retum avector with the strings 10 20 and 30 SI mlarly, split("do re ml fa so la tl do should return a vector with the strings "do "re "ml "fa so "la", "t", and "do" Write a program that inputs two strings and calls your function to split the first target string by the second delimiter string and prints the resulting vector al on line line with elements separated by commas. REQUIRED: You MUST use vectors to write th s program. You may not use any C++ functions that we have NOT dlscussed In lecture. The strings printed by the program should Include a newline at the end. ne of input from the user. A session should look like one of the following examples (including whitespace and formatting), with possibly differe The program should print a string of text to the terminal before getting each nt numbers in the output: Enter string to split: Enter deliriter string: The substrinR> arre: 10" 20", "30" OR Enter string ta split: delimit string The substrings are: "do "re", "ni", "fa", "so", "la 'ti", "do" Note: the fourth line in the second example has a single space character it is not an empty line)

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!