Line 30 is declaring a local capitalCount variable within your for-loop. Line 33 is incrementing that local, rather than the function-parameter returned at line 36 - which remains at zero the whole time. Also, because it's declared inside the for-loop, it's re-declared and re-created every time round the loop.
You don't need to have the capitalCount function-parameter at all as you're not doing anything with the information it gives inside the function.
So, 1) remove the capitalCount parameter, and 2) move your local declaration before the start of the for-loop so it's not reset every loop iteration.