Question: Strings batch 1 , batch 2 , and batch 3 are read from input. Each string represents a list of color ( s ) surrounded

Strings batch1, batch2, and batch3 are read from input. Each string represents a list of color(s) surrounded by "{" and "}".
Assign combinedColors with the concatenation of batch1, batch2, and batch3 in the order read.
Assign mergedList with a string that contains all the color(s) in batch1, batch2, and batch3 in the order read, separated by "" and surrounded by "{" and "}".
Ex: If the input is:
{ochre}
{magenta}
{blue}
then the output is:
All batches in one line: {ochre}{magenta}{blue}
One batch of all colors: {ochre magenta blue}

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 Programming Questions!