Menu

(Solved) : Input Ifstream Fin Fintxt Output Ofstream Txt Must C Q31642148 . . .

8 THE evenstats PROBLEM Write a function evenstats that accepts an input stream and an output stream as arguments. The input stream represents a series of integers: you may assume that there is at least one integer in the input Report the total number of numbers, the sum of the numbers, the count of even numbers and the percent of even numbers. For example, if an input stream contains the following text 5 7 2 8 9 10 12 98 7 14 28 22 Then the function should produce the following output: 12 numbers, sum 214 8 evens (66.67%)

input should be in an ifstream fin(“fin.txt”); and output shouldbe in an ofstream(“out.txt”);

must be in C++

8 THE evenstats PROBLEM Write a function evenstats that accepts an input stream and an output stream as arguments. The input stream represents a series of integers: you may assume that there is at least one integer in the input Report the total number of numbers, the sum of the numbers, the count of even numbers and the percent of even numbers. For example, if an input stream contains the following text 5 7 2 8 9 10 12 98 7 14 28 22 Then the function should produce the following output: 12 numbers, sum 214 8 evens (66.67%) Show transcribed image text

Expert Answer


Answer to Input Ifstream Fin Fintxt Output Ofstream Txt Must C Q31642148 . . .

OR