Over there we want to calculate the sum of all the items we have in the array. In order to do so we need to go through every element and add it together. Just like when you go to any self checkout when you scan each one of your items, on the screen you see the sum up to that point. That is what that variable is doing. Let me know if that doesn't make sense. If we don't create that variable we have no way of keeping track of the sum.
At 34:43 Why do you make a sumOfAllItems=0, then go on to do the loop for the sumOfAllItems?
Over there we want to calculate the sum of all the items we have in the array. In order to do so we need to go through every element and add it together. Just like when you go to any self checkout when you scan each one of your items, on the screen you see the sum up to that point. That is what that variable is doing. Let me know if that doesn't make sense. If we don't create that variable we have no way of keeping track of the sum.