Question: !!!C++!!! 16THE tokenStats PROBLEM Write a function tokenStats that accepts an input stream and an output stream as arguments. The input stream contains a series
!!!C++!!!

16THE tokenStats PROBLEM Write a function tokenStats that accepts an input stream and an output stream as arguments. The input stream contains a series of tokens. The function outputs the sum and count of all of the integers, the sum and count of all of the real numbers, and the total number of tokens of any type. You'll need string streams for this problem For example, if an input stream contains the following tokens: 3 3.14 10 squid 10.x 6.0 Then the output should be integers: 13 real numbers: 9.14 total tokens: 6 If the input stream has no tokens, the function should print: integers: 0 real numbers: 0.0 total tokens: 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
