Order of Statements

Shouldn’t we do the same for the numberOfSteps variable that we did for the distance variable? Meaning, I feel the print statement should be last statement after calculating the numberOfSteps and distance.

numberOfSteps should perhaps be initialized as 0 before taking any steps and then iterated after each key press, then printed to the console. I think the way this lecture ends, the number of steps will be printed as 1 the first two times.

Privacy & Terms