Problem :Complete Programming Project 9 onpage 367 of your textbook (shownbelow)
ID: 3614323 • Letter: P
Question
Problem:Complete Programming Project 9 onpage 367 of your textbook (shownbelow). Your 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:
lastNamefirstName 01 002 03 004 005 006 07 008 09010
The scoresmay be 1, 2 or 3 digits. The output is to be in a separate file,identical to the input file, except that there is one additionalfield, a double, at the end of each line. This number is to be theaverage of the 10 scores. Your program should also check thatthe input file exists before attempting to read from it. Additionally, you do NOT have to use functions, as indicated in theproject description in the book. You may create all theprogram parts inside of main().
Explanation / Answer
please rate - thanks you didn't say anything about arrays, so I didn't use any #include #include using namespace std; int main() {int i,sum,num; string first,last; double avg; ifstream in; ofstream out; in.open("Project_3.txt"); //open file if(in.fail()) //is it ok? { coutfirst; outRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.