Question: Level 2 ( weight: 7 5 % ) Once the basic function haveSameLetters has been completed, you can use it to accomplish the task for
Level weight:
Once the basic function haveSameLetters has been completed, you can use it to accomplish the
task for Level To run Level you simply have to pass in something other than you could pass in
or you could simply pass in no commandline argument at all.
When the command line argument is not the code in main branches off to the else block.
This is where you need to place your code for Level We have already provided the first part: words
are read in from standard input, and they are stored one by one inside a vector we are using the
Standard Template Library vector class for C In the next part of the code, you need to access
the words inside the vector, and print out all groups of words that have exactly the same letters.
Groups of words should be separated by commas no spaces and each group should appear on a
new line.
For example, if our input is
sore cake rose leaf teal fear late
Then the output should be
sore,rose
teal,late
words should appear in the order in which they were entered into the vector.
If the input is
earth heart hater atom moat mother
then the output should be
earth,heart,hater
atom,moat
Note that there are several tests in Level and it carries mor
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
