Question: I need help figuring out this C++ code. See instructions below: The scaffold code below accepts written descriptions of whitespace from the user and sets
I need help figuring out this C++ code.
See instructions below:


The scaffold code below accepts written descriptions of whitespace from the user and sets the value of the variable named separator accordingly. For example, if the user enters the string "newline the program will assign the value " " to separator. (This is done for the following input values: "tab", "space", "newline", and "null") Your assignment is create a new variable, called outputString, which uses the variable named separator in order to produce a poem that is formatted according to the desires of the user. The text of the poem you will use can be seen in the examples below. Each line of the poem should be followed by the escape character indicated by the user input. So if the user entered "newline", the lines of the poem should be separated by new lines, if the user entered "tab" the lines of the poem should be separated by tabs, and so forth. Sample Input newline Sample Output Roses are red Violets are blue I love to write code I hope you do too! Sample Input space Sample Output Roses are red Violets are blue I love to write code I hope you do too! Sample Input null Sample Output Roses are redViolets are blueI love to write code I hope you do too! Special Requirements Graded by TAS You must declare and use a variable named outputString (5 points) No "hard-coding' allowed. Specifically, you may not output different copies of the poem in different parts of the program. Just set the value of outputString once, and then display it to the user via cout. (20 points) You must adhere to the style guidelines (except the requirement to use endl instead of ). main.cpp Load default template... 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
