'sum' needs to sum all numbers entered by the user, not just the last number entered, which is what your code currently does. That's why it's zero.
In words, each time through the loop, sum =...
Type: Posts; User: GregBrannon
'sum' needs to sum all numbers entered by the user, not just the last number entered, which is what your code currently does. That's why it's zero.
In words, each time through the loop, sum =...
Check your formula for 'sum.' What is it currently the sum of? Is that 'sum' going to give you the desired average?
Hint: The formula for 'sum' (whatever it is) should be inside the do/while...
Can you give an example run to show what you mean? Copy the run from the console output and post it. Include a description of how the run is different than you expect.