Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have to Complete Programming Project 9 on page 367 ofyour textbook. The progra

ID: 3617316 • Letter: I

Question

I have to Complete Programming Project 9 on page 367 ofyour textbook. The program should read in data from a textfile. All entries on one line and are separated by one space.The 10 quiz scores are integers, and each line of the text file isformatted as such:

lastName firstName 01 002 03 004 005 006 07 008 09 010

The scores may be 1, 2 or 3 digits. The output is to be in aseparate file, identical to the input file, except that there isone additional field, a double, at the end of each line. Thisnumber is to be the average of the 10 scores. The programshould also check that the input file exists before attempting toread from it. Additionally, you do NOT have to use functions,as indicated in the project description in the book. You maycreate all the program parts inside of main().

Assuming the text file will benamed text_file, how do I finish this program. Please help. I willrate. And thankyou.

Explanation / Answer

please rate - thanks #include #include using namespace std; void calculate(ifstream&, ofstream&); int main() { ifstream in; ofstream out; in.open("input.txt");          //open file if(in.fail())            //is it ok?    { coutfirst; while(in)    {sum=0;    in>>last;    for(i=0;i>a[i];       sum+=a[i];       }    out