Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+9 votes

Project 1 Checkpoint B.

I have a loop inside of a loop statement and cannot get my final year totals to add up properly. Is there a good place to put a summation equation that will make my program add right?

asked in old_CSC201 by (1 point)

1 Answer

+2 votes

Since you are summing the final year's population, which is computed in the inner loop, then the summation equation that you need to compute the average should be after the inner loop, but within the outer loop (since you want to include the population of each country).

answered by (1 point)
...