A file with random numbers was provided and from that, a code needs to be produced to make 3 other files (one listing all the odd numbers, one listing all the even numbers and a statistic page with the largest integer, number of even and odd numbers, sum of all numbers and average of all). I got the first two files made, but am having trouble with the statistics one. I've attempted all the procedures in the statistic file aside from average and sum of all numbers because I'm really not sure how to enter it. Thanks
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int num;
string item;
int count = 0;
int evenCount = 0;
int oddCount = 1;
int sum = 0;
int even = 0;
int odd = 0;
int max = 0;
int avg;
avg = sum / count;
while (!inFile.eof())
{
inFile >> num;
if (num % 2 == 0)
{
evenFile << num << endl;
}