Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

Methods of Delivery Guidelines for

Answered: 1 week ago