Please help with project assignment!!!

Sorry I just need to edited it.
Last edited on
You seem to have a scope issue. It seems like some code got spliced between lines 121 and 131, resulting in a compilation error.

After patching the issue, you'd still have a problem as reading wouldn't stop until i (which, another scope issue, only exists in your for loop) reached 100, even if there were less than 100 words to read in your file.

Does this help?

-Albatross
hello @Albatross

so how can I fix it ? Please show me.. I am fixing it over and over but that still doesn't work.

Moving filewords out of the loop would be a start.

As for stopping reading at the right time and the variable shadowing problem (i being redeclared in a narrower scope)... think about what the while loop on 119 does. Do you need that inner for loop?

-Albatross
Topic archived. No new replies allowed.