am trying to write a c++ program that does the following:
1.reads five decimal numbers into a file "input.txt"
2.writes the five numbers from the file into an ouput file "output.txt"
3. calculates the sum of the five decimal numbers.
4. calculates the average of the five decimal numbers.
5. writes the sum and average into the file "output.txt"
help this extremely urgent....i can do the calculations its just the i/o stuff,
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Lol wrong section - this is mathematics.... but ill help a bit anyway.
Before I start, do you know for sure the file format is in decimals?
and are you not worried about finding the wrong file oir anything?
but if I were you, I'd do something along the lines of
// get file name
// do stuff (get ints out, do operations)
// put ints in