i come up with a additional set of numbers, but i don't know why.
Line #44 needs rewriting
while(inFile)
Change it to ..
while(inFile >> studentName >> quiz1 >> quiz2 >> quiz3 >> quiz4)
{
// rest of the code ...
}
Your while(inFile) is a variant to the theme of using .eof() in a loop control. Read Avoid Loop Control Using eof() courtesy of Dave Sinkula.
mitrmkar
Posting Virtuoso
1,834 posts since Nov 2007
Reputation Points: 1,119
Solved Threads: 399
Skill Endorsements: 8
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,875
Solved Threads: 953
Skill Endorsements: 27
please help.
Line 44 is
{
What was it before you rewrite it?
i even change it to this but still getting additional numbers.
Changed what to what? Are we supposed to not only find your bug but also find your changes. And in this unformatted code that Salem already pointed out?
Format your code, ask intelligent questions, don't make us guess, and you'll probably get an answer in 1 post, rather than all this lack of understanding on our part and frustration on your part.
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
Look at the file and the lines displayed. Which lines are displayed?
It looks like you're reading one line, throwing it away, then reading the next line and using it.
This is repeated.
Then you get to the EOF.
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
Question Answered as of 3 Years Ago by
WaltP,
Salem
and
mitrmkar