Explore BrainMass

C++ programs involving file reading and looping.

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Would you help me with the following two questions?

1. Write a code segment using a while loop that outputs the numbers from -10 to 10.

2. Write a looping code segment that takes as input up to 20 integer scores from file indata, and outputs their average. if the file contains fewer than 20 scores, the segment should still output the correct average. if the file contains more than 20 scores, the additional numbers should be ignored. be sure to consider what a happens if the file is empty.

© BrainMass Inc. brainmass.com March 21, 2019, 8:50 pm ad1c9bdddf

Solution Summary

The solution contains properly commented code for better understanding. The solution contains a code that is written using object oriented coding guidelines.