|
-
October 31st, 2012, 11:28 AM
#27
Re: College Lesson Trouble With Count/Sentinel Control Loops
Before worrying about every third number, you should get
the very first part correct: getting the average of all the numbers
in the file.
You have 2 ways of doing that:
1) Take away the read outside of the while loop, and use the while
loop that I posted. (best method)
2) keep you loop as is ... but inside the loop check the state
of the stream. If the stream's state is false, do not add num to total.
l
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|