Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ language Scores.txt : 10 20 30 40 50 60 -999 scoresout.txt : 45 55 65 75 85 95 -999 Write a program that reads
C++ language
Scores.txt :
10 20 30 40 50 60 -999
scoresout.txt :
45 55 65 75 85 95 -999
Write a program that reads in integer numbers from a file called scores.dat or scores.txt until the sentinel value -999 is read. The program should then output the total and average of the numbers read and output each of the numbers incremented by the overall average to a file called scoresout.dat or scoresout.txt along with then sentinel value of -999 at the end So if 10, 20, 30 and-999 are read in then the program would display a total of 60 and an average of 20 then output to the scoresout.dat file 30, 40, 50 and -999 Hint: So read the input file, calculate the total and the average, display them to the sreen then save them to separate variables and close the input file. Re-open the input file, open the output file, take each number from the input file, add the average to it then output it to the output file (except don't add the average to -999). A little trickier than I originally had thought but I think you can handle it.. Use good variable names and make sure your information prompts and output display items are full statements that ask a question and give a complete
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started