Question: Create a program to read the file numbers.txt where there are an unknown number of integer numbers. They must be added and averaged. The

Create a program to read the file "numbers.txt" where there are an unknown number of integer numbers. They must be added and averaged. The sum and the average must be displayed.
Example of file:
13
18
4
26
USE THE NEXT TEMPLATE (MANDATORY):
//DO NOT MODIFY THIS SECTION
#include
#include
using namespace std;
int main()
{
ifstream infile;
int num, sum=0;
float average;
infile.open( "numbers.txt");
//ADD YOUR CODE FROM HERE
}
Example:
Sum=61, average=15.25
Rubric

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!