I have this project that takes a team name, how many members are on a team and the individual times. I need to output the teamname and times (in seconds) and then the total time of each team. I'm having trouble adding the total team times.
while(infile.peek() !=EOF)
{
getline (infile, teamName);
infile >> numRunners;
cout << teamName << endl;
cout << numRunners << endl;
for (i=1; i<=numRunners; i++)
{
infile >> runMinutes >> runSeconds;
runTotal = (runMinutes * 60) + runSeconds;
cout << runTotal << endl; //for testing purposes, outputs run times
infile.ignore(1);