outfile <<"The Average for the number is "<<avgnum<<endl;
outfile <<"The trunc for the number is " <<truncnum<<endl;
outfile <<"The round of the number is " <<roundnum<<endl;
infile.close();
outfile.close();
system("pause");
return 0;
}
//Beginning of Average
float findavg()
{
float floatval, sum=0.0, sentinel, average;
int count=0;
infile>>floatval>>sentinel;
while(floatval !=sentinel)
{sum = sum + floatval;
count++;
infile>>floatval;
}
if(count)
average = sum/count;
else
average= -999999.0;
return average;
}//End of Average
//Begin Trunc Function
int findtrunc()
{
float floatval, sentinel;
int count = 0, trunc;
infile>>floatval>>sentinel;
while(floatval !=sentinel)
{
trunc=static_cast<int>(floatval);
count++;
infile>>floatval>>sentinel;
}
return trunc;
}//End of Trunc
//Beginning of Round
int findround()
{
float floatval, sentinel, sum=0.0;
float round, num;
int count = 0;
infile>> floatval>>sentinel;
while (floatval !=sentinel)
{
sum = sum + floatval;
round = floatval + .05;
num= round;