Question: in C++! 3 THE dupeCount PROBLeM Write a function dupeCount that accepts an input stream and an output stream as arguments. The input stream contains

in C++!
 in C++! 3 THE dupeCount PROBLeM Write a function dupeCount that

3 THE dupeCount PROBLeM Write a function dupeCount that accepts an input stream and an output stream as arguments. The input stream contains a series of lines as shown below. Examine each line looking for consecutive occurrences of the same token on the same line and output each duplicated token along how many times it appears consecutively. For example, if the input stream contains the following text: hello how how are you you you you I I I am Jack's Jack's smirking smirking smirking smirking smirking revenge bow wow wow yippee yippee yo yippee one fish two fish red fish blue fish It's the Muppet Show, wakka wakka wakka yippee yay yay yay Your function would produce the following output how 2 you*4 1#3 Jack's*2 smirking*5 WOw*2 yippee*2 yippee*2 yay#3 wakka*3 Only output repeated tokens; the ones that only appear once in a row are not shown. Place a single space between each reported duplicate token; respect the line breaks in the input. This is why a blank line appears in the expected output, corresponding to the fourth line of the input that did not contain any consecutively duplicated tokens. You may assume that each line of the input contains at least 1 token of

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!