Quote Originally Posted by GCDEF View Post
I hadn't read the original assignment about performing the tasks separately, but he shows you what you need to do. You will need multiple loops closing and reopening the file between them.

I've answered your question about repeating the last number several times now. You were on the right track earlier when you read the file before your loop, but you need to put the output before the input in the loop.
Ok I got it =P

Code:
total=0;
	counter=0;
	filein>>num;
	while(filein)
	{	
		
		fileout<<num<<" "; 
		filein>>num;
		total=total+num;
		counter++;
	}

	average = total/counter;
	fileout<<fixed<<setprecision(3)<<endl<<"The Average from the input file is: "<<average<<endl;
Chapter 8 assignment is where we do multiple loops using void functions... So I guess I need to do a separate print out for each one.