The posted code does that now. ????
What is the sample size? Can you count how many times the loop goes around?
Define a counter variable and add one to it each time the loop goes around.
...
Type: Posts; User: Norm
The posted code does that now. ????
What is the sample size? Can you count how many times the loop goes around?
Define a counter variable and add one to it each time the loop goes around.
...
Not sure what "assign a variable to each line" means? The code in Post#1 uses the content of each line to add 1 to a separate counter determined by the contents of each line. That code looks...
Now break step 3 down further. Its not detailed enough. One thing to consider when reading from a file is when there isn't any data left. Keep reading until no more data.
In step 4 Where do you...
Start by cleaning up the errors. Post the full text of the error messages.
Or another approach: throw out what you have coded and start fresh.
Make a list of the steps the program needs to do...