I need help on my lab, i just cannot get for the life of me.
This is the question and what I have did so far. Help
Store the following data in a file:
5 96 87 78 93 21 4 92 82 85 87 6 72 69 85 71 81 73
Write a program to calculate and display the average of each group of numbers. The data are arranged in the file so that each group of numbers is preceded by the number of data items in the group.
Use eof() for termination of the file.
Also write the average of each group to an output file.
Prompt the user for file name.
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
string filename;
int input1;
double avg1,avg2,avg3;
cout<<"Enter the name of the input file"<<endl;
cin >>filename;
ifstream inputfile;
inputfile.open(filename.c_str());
ofstream outfile ("lab7.out", ios::out);