Question: Write a complete C++ program to do the following: The main program will read in a string of three words, like Save our ships or
Write a complete C++ program to do the following: The main program will read in a string of three words, like "Save our ships" or "It is hot". Make sure that there is exactly one blank between each of the parts of the string. Then main will call several other functions to process that string. Print a few blank lines in the output and repeat the entire procedure until all strings have been read and processed.
In a loop that reads to end-of-input, the main program will read in and print a 3-word string of characters. The main program will print "Original string:" followed by the string. For each string read, the program will do the following processing:
breakup The main program will send the original string plus three empty strings to a function breakup. The function will break the string into three pieces, first, middle and last. These last 3 strings must be reference parameters so that the function can pass the three parts back to the main program for later use. The breakup function will separate the original string into three parts at the blanks. For example, if the original string is "Wy Lee coyote", the function will separate it into "Wy", "Lee" and "coyote". (Make sure that you do not put any of the blank spaces into any of the strings.) The original string should be unchanged. The main program will print the three parts, each on a new line, with identifying messages. For example, main could print the following:
Wy is first
Lee is middle
coyote is last
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
